[DB-SIG] mx.ODBC.Windows.Connect problem

Krjukov Victor VKryukov@ufg.com
Fri, 25 Oct 2002 21:59:17 +0400


Hi.

I have a following problem using Connect:

import mx.ODBC.Windows
C =3D mx.ODBC.Windows.Connect("driver=3D{SQL
Server};server=3Dzsun;uid=3D;pwd=3D;database=3Ddbcompany")

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
mxODBC.InternalError: ('S1090', 0, '[Microsoft][ODBC Driver Manager]
Invalid str
ing or buffer length', 5950)

However, the following VBA code works:

Sub a()
    Dim cnn1 As ADODB.Connection
   =20
    Set cnn1 =3D New ADODB.Connection
    cnn1.ConnectionString =3D "driver=3D{SQL
Server};server=3Dzsun;uid=3D;pwd=3D;database=3Ddbcompany"
    cnn1.Open
End Sub

Any ideas?

Thanks. Victor.