Hi Friends,
I am breaking my head since 2 days to get populate the local table using ADODB.recordset but can not figure it out.
I have a local table tblLocation_Local which I want to populate/fill with the back-end table tblLocation.
Both the tables have same structures.
I have this code:
Code:
' open the connection
OpenCon ' opens the connection - working correctly
Dim rst As ADODB.Recordset ' declare record set
Set rst = New ADODB.Recordset ' set recordset instance
With rst ' open recordset
.CursorLocation = adUseClient
.CursorType = adOpenForwardOnly
.Open ("Select tblLocation.* FROM tblLocation"), Connection
CurrentDb.Execute ("Insert INTO tblLocation_Local SELECT * FROM tblLocation") ' ---- HERE I NEED THE RECORDSET DATA TO ENTER IN THE LOCAL TABLE (tblLocation_Local)
End With
rst.Close
Set rst = Nothing ' close the recordset
Set Connection = Nothing ' close the connection
On Error GoTo Err
Err_Exit:
Exit Sub
Err:
MsgBox Err.DESCRIPTION
Resume Err_Exit
I need to get tblLocation_Local populated using ADODB.Recordset method so that it will be faster for users to get data from the local (Static) table instead of being connected all the times to the network.
Thanks!