Ombir
Active Member
- Joined
- Oct 1, 2015
- Messages
- 433
Hi Friends,
I'm using below code to get count of records in access table which has been updated through sql server through ADODB connection (lcnn).
The problem I'm facing is usercnt isn't get updated without delay of 5 secs. Code works fine in debug mode without using Sleep Api.
Can somebody help me with faster alternative (preferably without using recordset object) by which I can avoid 5 secs delay ??
I'm using below code to get count of records in access table which has been updated through sql server through ADODB connection (lcnn).
Code:
SQL1 = "INSERT INTO [Users] " & _
"Select DISTINCT USER_ID " & _
"FROM " & _
"[ODBC;Driver=SQL Server; " & "SERVER=Destiny\SQLEXPRESS;DATABASE=Sample;" & "UID=sam;PWD=password;]." & _ "[User_login] "
lcnn.Execute SQL1
Sleep 5000
usercnt = DCount("*", "users")
If usercnt >= 20 Then
'Do something
End If
The problem I'm facing is usercnt isn't get updated without delay of 5 secs. Code works fine in debug mode without using Sleep Api.
Can somebody help me with faster alternative (preferably without using recordset object) by which I can avoid 5 secs delay ??