2

I have a VB6 app that access's a database thru a ODBC Connection. It will run fine for a few hours then I get the following Error. Any Ideas?

[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite(WrapperWrite())
  • what is the point at which the error occurs? code sample please? – shahkalpesh Sep 17 '09 at 18:36
  • There is no common point at which the error occurs. I've tried to track it down, but it will run for hours fine, but it does always fail. –  Sep 17 '09 at 18:38
  • How are you connecting? Are you closing the connection when not needed? OR have you kept the connection open always? – shahkalpesh Sep 17 '09 at 18:46
  • I am connection using a ODBC connection. Initially the connection was opened at the beginning of the app, and closed when it was finished. My app is reading thru approx 410,000 rows in a sql database. I've tried breaking it down into smaller sections, CLose & reopening the connection at the beginning of each section, but i received the same error. –  Sep 18 '09 at 14:56

2 Answers2

0

Does your program have to reach across a network to get to the Access file?

If so I'd look into any intermittent network connectivity issues, especially if your program is always connected to the data source.

Check any logs you can to see what's happening on your network at the time of the error.

If possible change your app to connect to the data source only when you need to access it and then disconnect when done.

Is there more than one instance of the program running on the same and/or different machines? If so, do they all get the error at the same time?
If possible try to have more than one instance of you program running on the same machine and see if they all get the error at the same time.

Also:
Does the error happen about the same amount of time after initial connection?
Does the error happen about the same amount of inactivity in your application?

Jay Riggs
  • 53,046
  • 9
  • 139
  • 151
0

From Googling the error, it sounds like that's just ADO's way of saying it can't connect - that the server is unreachable. Are there are any other services on that server or that use the database that become unavailable at the same time as this error? It sounds like the client is just losing its connection, so I'd look for anything around that - dropped network connectivity, or a downed/overwhelmed server, to name a few examples.

SqlRyan
  • 33,116
  • 33
  • 114
  • 199