Home > Net >  VB.NET update ACCESS table, after the first query record number, return is always zero, but open the
VB.NET update ACCESS table, after the first query record number, return is always zero, but open the

Time:11-16

ImportCsvToAccess (Application. StartupPath & amp; "\ \ configuration data query results. CSV", "01 site," Application. StartupPath & amp; "\ dataZZ MDB")

STR table="01 site"
StrSQL="SELECT * FROM [" & amp; STR table & amp;"] "
Rst1=ExeSQLAccess (strSQL, ConnectStrAFOS)
If Rst1. Tables (0). Rows. Count & gt; 0 Then
StrSQL="INSERT INTO [00 import record]"
StrSQL=strSQL & amp; "(name of the table and record data, import time)"
StrSQL=strSQL & amp; "VALUES ("
StrSQL=strSQL & amp; "'" & amp; STR table & amp; "'" 'error
StrSQL=strSQL & amp; ", '" & amp; Rst1. Tables (0). Rows. Count & amp; "'" 'no.
StrSQL=strSQL & amp; ", '" & amp; Strdate & amp; "')" 'name
ExeSQLAccess (strSQL, ConnectStrAFOS)
End the If

Open the table saw record has been imported, but when the query table shows zero records; Step can display the normal record number; Feeling a cache update time, needs to trigger the next update;

CodePudding user response:

The Access itself is not so fast reaction, finished the check, then certainly no data, after you write, the query can do loop check, there will be

CodePudding user response:

Need to wait about half a second,

CodePudding user response:

To close the connection after each execution of the SQL, submit the data to the hard disk,

CodePudding user response:

Can Sleep 0.05 seconds, the System. The Threading. Thread. Sleep (50), is ok
  • Related