I have a requirement to display in a subform data from remote tables in an access database (900 miles away).
I do not want to link the tables because one table is quite large, the time to connect lengthens time my system is ready, I only need a subset of data (a month at a time) and I only need the data once a month for a series of reports.
I have created a local table that matches the dataset wanted.
I have developed a SQL query, open the database using the OpenDatabase method and can return the data as a recordset. I know I can step through the recordset one record at a time and do an insert of that record into the local database, but (while I haven't tested it) it seems that will be slow.
Here is my SQL Statement
Is there anyway to do a bulk insert using an insert statement like:
I know this can be done with tables residing in the same database, but the remote aspect as well as the inner joins has me stumped and not sure it can even be done.
Any ideas would be greatly appreciated.
Thanks
TC
I do not want to link the tables because one table is quite large, the time to connect lengthens time my system is ready, I only need a subset of data (a month at a time) and I only need the data once a month for a series of reports.
I have created a local table that matches the dataset wanted.
I have developed a SQL query, open the database using the OpenDatabase method and can return the data as a recordset. I know I can step through the recordset one record at a time and do an insert of that record into the local database, but (while I haven't tested it) it seems that will be slow.
Here is my SQL Statement
Code:
strSQL = "SELECT ApplicationCodes.App, ChapterTbl.ChapterName, OutputFilesTbl.FileIdent, " & _
"OutputFilesTbl.OutPutTitle, FileDataTbl.StatementDate, FileDataTbl.DateReleased, " & _
"FileDataTbl.TotalImages " & _
"FROM FileDataTbl " & _
"INNER JOIN (ApplicationCodes " & _
"INNER JOIN (ChapterTbl INNER JOIN OutputFilesTbl " & _
"ON ChapterTbl.ChapterID = OutputFilesTbl.pf_ChptID) " & _
"ON ApplicationCodes.APPID = ChapterTbl.pf_APPID) " & _
"ON FileDataTbl.pf_OutPutID = OutputFilesTbl.OutPutID " & _
"WHERE (FileDataTbl.StatementDate Between #" & Me.BDate & "# And #" & Me.EDate & "#) " & _
"ORDER BY ApplicationCodes.App, ChapterTbl.ChapterName;"
Debug.Print strSQL
Set rst = HinesdB.OpenRecordset(strSQL)
Is there anyway to do a bulk insert using an insert statement like:
Code:
INSERT INTO LocalTable (App, ChapterName, FileIdent, StatementDate,
DateReleased, TotalImages)
SELECT <using a variation of above>
I know this can be done with tables residing in the same database, but the remote aspect as well as the inner joins has me stumped and not sure it can even be done.
Any ideas would be greatly appreciated.
Thanks
TC