Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO and access

Status
Not open for further replies.

ratsstar99

Programmer
Aug 6, 2004
5
0
0
GB
I am using access 2000 database.
I have ado 2.7 library referenced in my VBA code. The code works fine but there is a synchronisation problem occuring which is resolved when i switch to DAO.

I Created a table in the database called temp which can hold integers in its only field 'Data'. I populate it with 50 integers using ado in a loop and show the contents of the table with a (tabular) form using the code below.

The form turns up empty unless i put in a 5 second delay between closing the recordset and showing the form. This problem is non existent when i switch the code to DAO.

Can anybody supply an explanation or recreate and confirm that its not just my machine?


Dim rs_Val As New ADODB.Recordset, sql As String
sql = "Select * from temp"
rs_Val.Open sql, g_Conn, adOpenDynamic, adLockOptimistic

Dim i As Integer
i = 0

While i < 50
i = i + 1
rs_Val2.AddNew
rs_Val2.Fields("Data") = i
rs_Val2.Update
Wend
rs_Val.Close

DoCmd.OpenForm "temp", acNormal, , , , acWindowNormal



Thanks,
R
 
not a chance .... but thanks for the thought cycles

the problem seems to be a driver issue or something,

the records go into the database but the form just does not see them fast enough
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top