[AccessD] Move Data from SQL Table to Access FE Table

Bobby Heid bheid at sc.rr.com
Sun Dec 7 18:23:25 CST 2008


Dan,

What about something like (air code and assumes LocalIDTable and SQLTable
both have a field called ID):

Dim db as database
Dim sql as string

sql = "INSERT INTO LocalIDTable " & _
	   "SELECT ID " & _
		"From SQLTable"

Set db=currentdb()
Db.execute sql,dbfailonerror
Db.close
Set db=nothing


If the above sql statement isn't exactly what you need it should point you
in the right direction.

Bobby


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Sunday, December 07, 2008 6:58 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Move Data from SQL Table to Access FE Table

I'm learning to use SQL as a BE for Access apps.  The connection method is
OLEDB rather than ODBC tables.

I would like to copy a list of record ID's from a table in the SQL BE to a
local FE table each time a process screen is opened.  I'm doing this by
opening a view from Access, creating an ADODB recordset, and then looping
through that recordset to insert the ID numbers into a local FE table.

But, looping to do this seems quite inefficient for hundreds or thousands of
rows. 

Is there a better way?

Thanks!
Dan




-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list