I wish to copy a table on a SQL Server backend to a table on an Access
(.mdb) front end in the simplest way.
I have the following to get the recordset but am seeking something
easier.
Dim theConnectionString
theConnectionString = "Driver=SQL Server;
Server=Server;Database=myData;Trusted_Connection=Y es"
Dim rec As ADODB.Recordset
Set rec = New ADODB.Recordset
Dim theSQLString
theSQLString = "Select * From backEndTable"
rec.Open theSQLString, theConnectionString, adOpenStatic,
adLockOptimistic
Do Until rec.EOF
' copy each record to the frontEndTable, field by field
rec.MoveNext
Loop
This will work but I want to be able to copy from the back end to the
front end in a simpler way. Either some SQL on the backend which can
copy directly to the frontend; but I do not know how to specify the
frontend table in a way that the backend understands.
Alternatively, having got the recordset, I would like to copy all of it
to the frontend table in a single statement without having to loop
through the records. Something like "copy the recordset 'rec' to
the table 'frontEndTable'"
Are either of these possible? If so, how?