Timeout Expired

Funger

Registered User.
Local time
Yesterday, 19:44
Joined
Jan 16, 2004
Messages
18
Hi all. I have a small problem.

I am writing VB code to manipulate a SQL database.

I need to open a recordset to a table that holds hundreds of thousands of records, if not millions.

At this point I don't need to access the data in the table, but I do need to be able to append to this table. If I do need to access the data in the table it would be limited to finding the ID of the last record I created.

I also would like to create a recordset as opposed to using an APPEND SQL statement, because the coding is easier for the multiple situations that can arise.

My problem is when I open a recordset to this table, I get a Timeout Expired error.

Is there a flag I can use to make the recordset append-only so that it doesn't try to bring down any data first? (hopefully then avoiding the timeout error)

Thanks!

The code that I am currently using is listed below:


Dim rstA As Recordset
Dim conA As Connection

Set conA = New ADODB.Connection
conA.ConnectionTimeout = 0
conA.Open "blah,blah,blah"

Set rstA = New ADODB.Recordset

strSQL = ""
strSQL = strSQL & "SELECT Attendance.* FROM Attendance;"
rstA.Open strSQL, conA, adOpenKeyset​
, adLockOptimistic, adCmdText
 

Users who are viewing this thread

Back
Top Bottom