Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Connection string corruption in Access 2002?
Mon, Mar 26 2007 9:33 AMPermanent Link

hjt
Hello,

i am using odbc driver 3.30.01.01 for MS Access (2002). I found my Access app very unstable because of the ODBC driver. Sometimes Access simply dies, without any warning message
and after some time there is no way to get access to the ODBC connected table. Then i have to create a new System ODBC data source (simply reconnect to the old data source in Access
doesn't work).

If i do a "Debug.Print tbl.Connect" in VBA i get the following string:

ODBC;DSN=uuu;Driver=C:\dbisam\odbc\std\ver3
\lib\dbodbc\dbodbc.dll;ConnectionType=Local;RemoteType=LAN;RemoteHostName=;RemoteIPAddress=127.0.0.1;RemotePort=12005;RemoteService=;RemoteReadAhead=50;MRUDatabas
e1=Memory;MRUDatabase2=C:\IMMO98\Daten;CatalogName=C:\IMMO98\Date

As you see, the end of the connection string is somehow stripped - is there any length restriction in the ODBC connection string?

thank you
hjt
Mon, Mar 26 2007 9:51 AMPermanent Link

hjt
I did some further testing: If i try to set the connection string programmatically, i get the error message "3210 Connect string too long"
I cut some parameters from the connection string:
ODBCConnectString = "ODBC;DSN=kkkkk;Driver=C:\dbisam\odbc\std\ver3
\lib\dbodbc\dbodbc.dll;ConnectionType=Local;RemoteType=LAN;RemoteIPAddress=127.0.0.1;RemotePort=12005;MRUDatabase2=C:\IMMO98\Daten;CatalogName=C:\IMMO98\Daten\Objekte"

Looks like a solution for my problem.

thank you
hjt
Mon, Mar 26 2007 9:31 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< If i do a "Debug.Print tbl.Connect" in VBA i get the following string:

ODBC;DSN=uuu;Driver=C:\dbisam\odbc\std\ver3
\lib\dbodbc\dbodbc.dll;ConnectionType=Local;RemoteType=LAN;RemoteHostName=;RemoteIPAddress=127.0.0.1;RemotePort=12005;RemoteService=;RemoteReadAhead=50;MRUDatabas e1=Memory;MRUDatabase2=C:\IMMO98\Daten;CatalogName=C:\IMMO98\Date As you see, the end of the connection string is somehow stripped - is thereany length restriction in the ODBC connection string? >>There isn't a length restriction on the ODBC connection string, but Accessdoesn't like particularly long connection strings, and only allocates a verysmall buffer for them irrespective of what the ODBC driver indicates thelength should be.  IOW, Access has the ability to call the ODBC driver firstto find out the actual length of the connection string, allocate the properbuffer size, and then call the same function again to populate the buffer.However, it doesn't do so and passes a fixed-length buffer at all times.  Ican't remember the exact length of the buffer that it passes, but it'sfairly small (127 bytes or something similar).The only workaround for version 3.x is to reduce the size of the connectionstring manually.  Version 4.x of our ODBC driver removes extraneousconnection attributes when it detects that Access is performing the functioncall.--Tim YoungElevate Softwarewww.elevatesoft.com
Wed, Mar 28 2007 7:53 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorry about the lack of line feeds, I'm not sure what OE is doing with my
post:

<< If i do a "Debug.Print tbl.Connect" in VBA i get the following string:

ODBC;DSN=uuu;Driver=C:\dbisam\odbc\std\ver3
\lib\dbodbc\dbodbc.dll;ConnectionType=Local;RemoteType=LAN;RemoteHostName=;RemoteIPAddress=127.0.0.1;RemotePort=12005;RemoteService=;RemoteReadAhead=50;MRUDatabase1=Memory;MRUDatabase2=C:\IMMO98\Daten;CatalogName=C:\IMMO98\Date As yousee, the end of the connection string is somehow stripped - is thereanylength restriction in the ODBC connection string? >>There isn't a length restriction on the ODBC connection string, but Accessdoesn't like particularly long connection strings, and only allocates a verysmall buffer for them irrespective of what the ODBC driver indicates thelength should be.  IOW, Access has the ability to call the ODBC driver firstto find out the actual length of the connection string, allocate the properbuffer size, and then call the same function again to populate the buffer.However, it doesn't do so and passes a fixed-length buffer at all times.  Ican't remember the exact length of the buffer that it passes, but it'sfairly small (127 bytes or something similar).The only workaround for version 3.x is to reduce the size of the connectionstring manually.  Version 4.x of our ODBC driver removes extraneousconnection attributes when it detects that Access is performing the functioncall.--Tim YoungElevate Softwarewww.elevatesoft.com
Image