OLE DB Error Runtime Error: - '2147217887 (80040e21)'

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have an Access 97 database with VBA code that is designed to import data
into text files from various data sources. A VB Script is scheduled as a
windows task and it calls the Access VBA code (sometimes 5 times for 5 data
sources). This works fine most of the time but I occasionally get
connectivity errors. I read article 269495 for the error: Multiple-step OLE
DB operation generated errors" when opening ADO connection but it doesn't
deal with "intermittent" causes. Here is part of the code that creates the
connection and recordsets:

Set conn = CreateObject("ADODB.Connection")
Set res = CreateObject("ADODB.Recordset")

conn.Open "FILEDSN=" & strODBC 'VB Script passes the location of the
FILEDSN
res.LockType = 1
res.Open strRecSet, conn

AND Later (another is created a little differenly):

Set conn1 = CreateObject("ADODB.Connection")
conn1.ConnectionString = "FILEDSN=" & UDDEST
conn1.Open

Set comm1 = CreateObject("ADODB.Command")
Set comm1.ActiveConnection = conn1

Any suggestions on why this might occur very intermittently? Is the code
OK? Would it just be due to a slow network ?

Thanks
 
An additional piece of information. Everything ran fine this morning. The
code is designed to retrieve the previous days information only. When I
changed the code to go back 2 days to get the missing data, the same error
displayed. I've looked at the data source for odds data entries but don't
see anything. Could bad data even cause this error?
Thanks
 
Back
Top