Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have an Excel sheet that connects to a SQL Server and fetches data via ADODB. It works fine on all machines but one, where I get the runtime error 91 at the last code line when creating the connection object. Dim ADOCmd As New ADODB.Command Dim ADOPrm As New ADODB.Parameter Dim ADOCon As ADODB.Connection Dim ADORs As ADODB.Recordset Dim sParmName As String Dim strConnect As String Dim rStr As String On Error GoTo ErrHandler strConnect = CONNSTR Set ADOCon = New ADODB.Connection We have reinstalled MDAC 2.8 RTM, which is the same version used on the machines where the code works. We have also tried to create a manual database query from Excel (Data menu, Import External Data ...) which works fine. Any tips? Brgds Jonas |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
#1 suspect would be the ADO refernce not the same version
1 - option Explicit then debug and / or compare results on a "working" pc to the "non-working" pc VBE ToolsRefernces Checked Available refernces: Microsoft ActiveX Data Objects 2.8 Library "Jonas" wrote: Hi I have an Excel sheet that connects to a SQL Server and fetches data via ADODB. It works fine on all machines but one, where I get the runtime error 91 at the last code line when creating the connection object. Dim ADOCmd As New ADODB.Command Dim ADOPrm As New ADODB.Parameter Dim ADOCon As ADODB.Connection Dim ADORs As ADODB.Recordset Dim sParmName As String Dim strConnect As String Dim rStr As String On Error GoTo ErrHandler strConnect = CONNSTR Set ADOCon = New ADODB.Connection We have reinstalled MDAC 2.8 RTM, which is the same version used on the machines where the code works. We have also tried to create a manual database query from Excel (Data menu, Import External Data ...) which works fine. Any tips? Brgds Jonas |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime error prevents Excel 2000 to save file | Excel Worksheet Functions | |||
connecting to back end server | Excel Discussion (Misc queries) | |||
Excel 2003 Error Cannot Locate the Internet Server or Proxy Server | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Excel Connecting to SQL Server Database - Need your Help | Excel Programming |