Does anyone know how to use the INSERT INTO statement with ADO to inset records into a seperate datbase?
Printable View
Does anyone know how to use the INSERT INTO statement with ADO to inset records into a seperate datbase?
I know that Access/DAO supports this SQL syntax:
INSERT INTO TableName IN OtherDB VALUES(whatever)
For example, you could say:
dbOne.Execute "INSERT INTO MyTable IN 'C:\MyDB2.MDB' VALUES('A', 1, 'B')"
I don't know if the DB you are using supports the IN clause in the INSERT statement (and in ADO, the Execute method is on the connection, not the DB, right?). Good luck.
Just use the normal insert into statement that enough already.
Let assume your database is save at C:\MyDb with filename Database2.mdb. Inside this database you have a table name TblMyTable that consits of three fields that store TEXT datatype and the INSERT INTO statement just look like below:
:)Code:INSERT INTO [C:\MyDb\Database2.mdb].[TblMyTable] VALUES ('Data1', 'Data2', 'Data3');