View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jonas[_2_] Jonas[_2_] is offline
external usenet poster
 
Posts: 1
Default Runtime error 91 when connecting to SQL Server 2000

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