Insert into external database

  • Thread starter Thread starter Hayden
  • Start date Start date
H

Hayden

Guest
I am trying to move data in one table to a table in an external database and Access isn't playing ball. Supposedly you can use the 'IN' clause to link to an external database but if I put it in then I get 'Syntax error in INSERT INTO statement' and if I take it out it works fine not that, that is what I want. It's syntax seems to be defined like below at the MS website - jet reference???

I've also got a parameter that I'm trying to feed it, that is the path to the database, which is correct! c:\help\content.mdb

Here's the query
INSERT INTO CONTENT_CLASSES IN '"+ @DBDir +"' ( PARENT_ID, CLASS_NAME, STATUS_ID, KEYWORDS, PRIORITY, LAST_CHANGED_BY, LAST_CHANGED_DATE, MULTIPLE_CONTENT )
SELECT A.PARENT_ID, A.CLASS_NAME, A.STATUS_ID, A.KEYWORDS, A.PRIORITY, A.LAST_CHANGED_BY, A.LAST_CHANGED_DATE, A.MULTIPLE_CONTENT
FROM CONTENT_CLASSES AS A;
 
Last edited:
Reply Insert into external database

Well I've figured it out on my lonesome. The syntax was wrong and MS help and website only confused things with their givings. This is how it should have been. External database on the end. I wrote it dynamically in the end with asp as I couldn't figure out how it could work as a stored query. If anyone can shed some light on that I'd be most interested!

insertQry = "INSERT INTO CONTENT_CLASSES(CLASS_ID, PARENT_ID, CLASS_NAME, STATUS_ID, KEYWORDS, PRIORITY, LAST_CHANGED_BY, LAST_CHANGED_DATE, MULTIPLE_CONTENT) IN '" & DBDir & "' SELECT A.CLASS_ID, A.PARENT_ID, A.CLASS_NAME, A.STATUS_ID, A.KEYWORDS, A.PRIORITY, A.LAST_CHANGED_BY, A.LAST_CHANGED_DATE, A.MULTIPLE_CONTENT FROM CONTENT_CLASSES AS A;"
 

Users who are viewing this thread

Back
Top Bottom