Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append MS SQL table from MS Access table

Status
Not open for further replies.

goingkraze

Technical User
Apr 15, 2002
3
US
I have been asked to write a piece of code to take a local MS Access table and bulk load to the MS SQL table. I have searched for threads, but just can't figure out how to get a SQL statement to recognize the local table.

I have this so far
MyCon.Execute ("INSERT INTO WAREHOUSE.dbo.TABLE1 SELECT * FROM Table1;")

but it does not recognize the MS Access table "Table1"

Any help is greatly appreciated.

Thanks
 
I think you will find this easier if you just set up a linked table, or set up a DTS to pull from Access into SQL (rather than push data out). The reason your query is not working, is because it looks for Table1 in the SQL Server Database defined in your connection string.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
I used the link table to refresh. It is a little slow, but this is only a interim solution until I can get the formal DTS in place.

Thanks AlexCuse for you help.
 
DTS is the best way to do it (IMO of course). I am glad you are pursuing that route :)

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top