Joelo
MIS
- Sep 27, 2003
- 61
I am trying to move all records from one database (databasetemp) to another database (databaseoutput) and delete all records in databasetemp leaving it blank for future use....But I keep getting the following Error:
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/compliance/move3.asp, line 78
Line 78 is:
conn.execute strsql1
Please anybody help me with my script, I don't know what I am doing wrong
<%@ Language="VBScript"%>
<% Option Explicit
response.buffer = true
Dim xDb_Conn_Str
Dim Conn
Dim strsql
Dim strsql1
xDb_Conn_Str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("dboutput\Databaseoutput.mdb" & ";"
set conn = Server.CreateObject("ADODB.Connection"
conn.Open xDb_Conn_Str
' Build Query
strsql = "INSERT INTO bsldatabase (FACILITYCOMPONENTID, " & _
" COMPONENTDESCRIPTION, " & _
" DEVICEID, " & _
" ISSTACKARRESTORINSTALLED, " & _
" ISFLAMEARRESTORINSTALLED, " & _
" DIDALARMOPERATEATWONDERWAREANDSHUTDOWNLOCALPANEL, " & _
" TESTDATE, " & _
" NEXTDUETESTDATE, " & _
" MONTHYEAR, " & _
" FACILITY, " & _
" AREA, " & _
" TECHNICIANSNAME, " & _
" COMMENTS, " & _
" USERID " & _
" ) " & _
" SELECT [bsldatabase.FACILITYCOMPONENTID], " & _
" [bsldatabase.COMPONENTDESCRIPTION], " & _
" [bsldatabase.DEVICEID], " & _
" [bsldatabase.ISSTACKARRESTORINSTALLED], " & _
" [bsldatabase.ISFLAMEARRESTORINSTALLED], " & _
" [bsldatabase.DIDALARMOPERATEATWONDERWAREANDSHUTDOWNLOCALPANEL], " & _
" [bsldatabase.TESTDATE], " &_
" [bsldatabase.NEXTDUETESTDATE], " & _
" [bsldatabase.MONTHYEAR], " & _
" [bsldatabase.FACILITY], " & _
" [bsldatabase.AREA], " & _
" [bsldatabase.TECHNICIANSNAME], " & _
" [bsldatabase.COMMENTS], " & _
" [bsldatabase.USERID] " & _
" from ["& server.mappath("dbtemp\Databasetemp.mdb" & "].bsldatabase "
conn.execute strsql
Response.Write strsql
strsql1 = "INSERT INTO devicebsldevice (FACILITYCOMPONENTID, " & _
" DEVICEID, " & _
" ISDEVICEOPERABLE, " & _
" DIDFIREDCOMPONENTSHUTDOWN, " & _
" ISFLAMEARRESTORINSTALLED, " & _
" ISSTACKARRESTORINSTALLED, " & _
" DIDALARMOPERATEDURINGTEST, " &_
" DIDDEVICEINDICATEANDALARMATPLC, " &_
" ANNUALTESTDATE, " & _
" MONTHYEAR, " & _
" FACILITY, " & _
" AREA, " & _
" TECHNICIANNAME, " & _
" COMMENT, " & _
" SECTION, " & _
" USERID " & _
" ) " & _
" SELECT [devicebsldevice.FACILITYCOMPONENTID], " & _
" [devicebsldevice.DEVICEID], " & _
" [devicebsldevice.ISDEVICEOPERABLE], " & _
" [devicebsldevice.DIDFIREDCOMPONENTSHUTDOWN], " & _
" [devicebsldevice.ISFLAMEARRESTORINSTALLED], " & _
" [devicebsldevice.ISSTACKARRESTORINSTALLED], " & _
" [devicebsldevice.DIDALARMOPERATEDURINGTEST], " & _
" [devicebsldevice.DIDDEVICEINDICATEANDALARMATPLC], " & _
" [devicebsldevice.ANNUALTESTDATE], " & _
" [devicebsldevice.MONTHYEAR], " & _
" [devicebsldevice.FACILITY], " & _
" [devicebsldevice.AREA], " & _
" [devicebsldevice.TECHNICIANNAME], " & _
" [devicebsldevice.COMMENT], " & _
" [devicebsldevice.SECTION], " & _
" [devicebsldevice.USERID] " & _
" from ["& server.mappath("dbtemp\Databasetemp.mdb" & "].devicebsldevice "
Response.Write strsql
conn.execute strsql1
set strsql = Nothing
set xDb_Conn_Str = Nothing
xDb_Conn_Str1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("dbtemp\Databasetemp.mdb" & ";"
set conn = Server.CreateObject("ADODB.Connection"
conn.Open xDb_Conn_Str1
conn.Execute = "DELETE INTO bsldatabase"
conn.Execute = "DELETE INTO devicebsldevice"
set conn = Nothing
set xDb_Conn_Str1 = Nothing
conn.Close
%>
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/compliance/move3.asp, line 78
Line 78 is:
conn.execute strsql1
Please anybody help me with my script, I don't know what I am doing wrong
<%@ Language="VBScript"%>
<% Option Explicit
response.buffer = true
Dim xDb_Conn_Str
Dim Conn
Dim strsql
Dim strsql1
xDb_Conn_Str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("dboutput\Databaseoutput.mdb" & ";"
set conn = Server.CreateObject("ADODB.Connection"
conn.Open xDb_Conn_Str
' Build Query
strsql = "INSERT INTO bsldatabase (FACILITYCOMPONENTID, " & _
" COMPONENTDESCRIPTION, " & _
" DEVICEID, " & _
" ISSTACKARRESTORINSTALLED, " & _
" ISFLAMEARRESTORINSTALLED, " & _
" DIDALARMOPERATEATWONDERWAREANDSHUTDOWNLOCALPANEL, " & _
" TESTDATE, " & _
" NEXTDUETESTDATE, " & _
" MONTHYEAR, " & _
" FACILITY, " & _
" AREA, " & _
" TECHNICIANSNAME, " & _
" COMMENTS, " & _
" USERID " & _
" ) " & _
" SELECT [bsldatabase.FACILITYCOMPONENTID], " & _
" [bsldatabase.COMPONENTDESCRIPTION], " & _
" [bsldatabase.DEVICEID], " & _
" [bsldatabase.ISSTACKARRESTORINSTALLED], " & _
" [bsldatabase.ISFLAMEARRESTORINSTALLED], " & _
" [bsldatabase.DIDALARMOPERATEATWONDERWAREANDSHUTDOWNLOCALPANEL], " & _
" [bsldatabase.TESTDATE], " &_
" [bsldatabase.NEXTDUETESTDATE], " & _
" [bsldatabase.MONTHYEAR], " & _
" [bsldatabase.FACILITY], " & _
" [bsldatabase.AREA], " & _
" [bsldatabase.TECHNICIANSNAME], " & _
" [bsldatabase.COMMENTS], " & _
" [bsldatabase.USERID] " & _
" from ["& server.mappath("dbtemp\Databasetemp.mdb" & "].bsldatabase "
conn.execute strsql
Response.Write strsql
strsql1 = "INSERT INTO devicebsldevice (FACILITYCOMPONENTID, " & _
" DEVICEID, " & _
" ISDEVICEOPERABLE, " & _
" DIDFIREDCOMPONENTSHUTDOWN, " & _
" ISFLAMEARRESTORINSTALLED, " & _
" ISSTACKARRESTORINSTALLED, " & _
" DIDALARMOPERATEDURINGTEST, " &_
" DIDDEVICEINDICATEANDALARMATPLC, " &_
" ANNUALTESTDATE, " & _
" MONTHYEAR, " & _
" FACILITY, " & _
" AREA, " & _
" TECHNICIANNAME, " & _
" COMMENT, " & _
" SECTION, " & _
" USERID " & _
" ) " & _
" SELECT [devicebsldevice.FACILITYCOMPONENTID], " & _
" [devicebsldevice.DEVICEID], " & _
" [devicebsldevice.ISDEVICEOPERABLE], " & _
" [devicebsldevice.DIDFIREDCOMPONENTSHUTDOWN], " & _
" [devicebsldevice.ISFLAMEARRESTORINSTALLED], " & _
" [devicebsldevice.ISSTACKARRESTORINSTALLED], " & _
" [devicebsldevice.DIDALARMOPERATEDURINGTEST], " & _
" [devicebsldevice.DIDDEVICEINDICATEANDALARMATPLC], " & _
" [devicebsldevice.ANNUALTESTDATE], " & _
" [devicebsldevice.MONTHYEAR], " & _
" [devicebsldevice.FACILITY], " & _
" [devicebsldevice.AREA], " & _
" [devicebsldevice.TECHNICIANNAME], " & _
" [devicebsldevice.COMMENT], " & _
" [devicebsldevice.SECTION], " & _
" [devicebsldevice.USERID] " & _
" from ["& server.mappath("dbtemp\Databasetemp.mdb" & "].devicebsldevice "
Response.Write strsql
conn.execute strsql1
set strsql = Nothing
set xDb_Conn_Str = Nothing
xDb_Conn_Str1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("dbtemp\Databasetemp.mdb" & ";"
set conn = Server.CreateObject("ADODB.Connection"
conn.Open xDb_Conn_Str1
conn.Execute = "DELETE INTO bsldatabase"
conn.Execute = "DELETE INTO devicebsldevice"
set conn = Nothing
set xDb_Conn_Str1 = Nothing
conn.Close
%>