Hi there,
I'm trying to fetch data from a table in another database and insert it into a table in the current database.
Dim strConnection, conn, rs, strSQL
strConnection = "DRIVER={SQL server};SERVER=zfrdc003;DATABASE=SitetrackerTest;ID=Integrationdb;pwd=I&A;"
Set conn = CreateObject("ADODB.Connection")
conn.Open strConnection
Set rs = CreateObject("ADODB.recordset")
DoCmd.RunSQL "INSERT INTO [WorkPackages] ([Planned Start Date]) SELECT [Date] FROM vReport_WorkPackage_Dates WHERE WPID = " & "2878"
Using the above code I get an invalid object error on vReport_WorkPackage_Dates. I presume there is some confusion as to which table is in which database.
Can anyone advise?
I'm trying to fetch data from a table in another database and insert it into a table in the current database.
Dim strConnection, conn, rs, strSQL
strConnection = "DRIVER={SQL server};SERVER=zfrdc003;DATABASE=SitetrackerTest;ID=Integrationdb;pwd=I&A;"
Set conn = CreateObject("ADODB.Connection")
conn.Open strConnection
Set rs = CreateObject("ADODB.recordset")
DoCmd.RunSQL "INSERT INTO [WorkPackages] ([Planned Start Date]) SELECT [Date] FROM vReport_WorkPackage_Dates WHERE WPID = " & "2878"
Using the above code I get an invalid object error on vReport_WorkPackage_Dates. I presume there is some confusion as to which table is in which database.
Can anyone advise?