I am trying to append data from a database held on a webserver, to a replica database on our work server.
I have the following code.
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("Passwords")
objConn.Open
Dim objRS, strSQL
strSQL = "INSERT INTO tblEmailUpdates ( ContactName, CompanyName, Website, Email )" & _
"IN 'F:\Web Sites\SoftSource\Database Information\Passwords.mdb'" & _
"SELECT tblEmailUpdates.ContactName, tblEmailUpdates.CompanyName, tblEmailUpdates.Website, " & _
"tblEmailUpdates.Email " & _
"FROM tblEmailUpdates;"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
If I take out the INSERT INTO line and just start it from the SELECT part of the statement, it works fine.
Any ideas?
I have the following code.
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("Passwords")
objConn.Open
Dim objRS, strSQL
strSQL = "INSERT INTO tblEmailUpdates ( ContactName, CompanyName, Website, Email )" & _
"IN 'F:\Web Sites\SoftSource\Database Information\Passwords.mdb'" & _
"SELECT tblEmailUpdates.ContactName, tblEmailUpdates.CompanyName, tblEmailUpdates.Website, " & _
"tblEmailUpdates.Email " & _
"FROM tblEmailUpdates;"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
If I take out the INSERT INTO line and just start it from the SELECT part of the statement, it works fine.
Any ideas?