ratsstar99
Programmer
I am using access 2000 database on windows xp.
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
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