PDA

View Full Version : opening access database from network took so long.



atzdgreat
02-03-2018, 02:33 AM
Hi guyz,

i was trying to figure out why is it that if i'm going to open my database in network took me 45 seconds to 1 mins for 435 records only.



DatabasePath = "Network"
DbName = DatabasePath & "db.accdb"
Set db = OpenDatabase(DbName, False, True, "MS Access;PWD=pwd")
Set rs = db.OpenRecordset("SELECT field1, field2 FROM table WHERE id = '" & lblIndRecID.Caption & "'", dbOpenDynaset)
lvStaffRecord.ListItems.Clear


If rs.RecordCount = 0 Then
Else
With rs
Do Until .EOF
Set li = lvStaffRecord.ListItems.Add(, , Format(!field1, "MM/DD/YYYY"))
li.SubItems(1) = !field2
.MoveNext
Loop
End With
End If




but when i put sample database in my local drive. and set my databasepath.. it took only 4 sec?

any help from you will really appreaciate.. thanks