I inserting data into a table, but I think my sql string is way too long! The syntax message I get is "Syntax error in INSERT INTO statement." Im not sure if I need to break it up, what method would I go about breaking it up. I am including the sql string in hopes that someone can help me out. Thanks in advance.
<!--#include file="Conn.asp"-->
<%
dim strSQL
strSQL ="INSERT INTO Request(Request_Date,Request_Time,Employee_ID,Employee_Name,Employee_Status,"&_
"Employee_Department,Airline_Preference,Departure_City,Departure_Code,Departure_Date,Departure_Time, "&_
"1st_DepartureCity,1st_DepartureCode,1st_DepartureAirTravel,1st_AirPreference,1st_Hotel,1st_Car, "&_
"1st_aDate,1st_aTime,1st_aCity,1st_aAddress,1st_bDate,1st_bTime,1st_bCity,1st_bAddress, "&_
"2nd_DepartureCity,2nd_DepartureCode,2nd_DepartureAirTravel,2nd_AirPreference,2nd_Hotel,2nd_Car, "&_
"2nd_aDate,2nd_aTime,2nd_aCity,2nd_aAddress,2nd_bDate,2nd_bTime,2nd_bCity,2nd_bAddress, "&_
"3rd_DepartureCity,3rd_DepartureCode,3rd_DepartureAirTravel,3rd_AirPreference,3rd_Hotel,3rd_Car, "&_
"3rd_aDate,3rd_aTime,3rd_aCity,3rd_aAddress,3rd_bDate,3rd_bTime,3rd_bCity,3rd_bAddress, "&_
"4th_DepartureCity,4th_DepartureCode,4th_DepartureAirTravel,4th_AirPreference,4th_Hotel,4th_Car, "&_
"4th_aDate,4th_aTime,4th_aCity,4th_aAddress,4th_bDate,4th_bTime,4th_bCity,4th_bAddress)"
strSQL = strSQL & "VALUES('"& request.form("txtDate" &"','"
strSQL = strSQL & request.form("txtTime" & "','"
strSQL = strSQL & request.form("txtEmployeeID" & "','"
strSQL = strSQL & request.form("txtEmployeeName" & "','"
strSQL = strSQL & request.form("txtEmployeeStatus" & "','"
strSQL = strSQL & request.form("txtEmployeeDepartment" & "','"
strSQL = strSQL & request.form("txtAirlinePreference" & "','"
strSQL = strSQL & request.form("txtDepartureCity" & "','"
strSQL = strSQL & request.form("txtDeptCode" & "','"
strSQL = strSQL & request.form("txtDepartureDate" & "','"
strSQL = strSQL & request.form("cboDepartureTime" &" "& request.form("cboTime" & "','"
strSQL = strSQL & request.form("txt1stDepartureCity" & "','"
strSQL = strSQL & request.form("txt1stDepartureCode" & "',"
strSQL = strSQL & request.form("chk1stAirTravel" & ",'"
strSQL = strSQL & request.form("cbo1stDeparturePreference" & "',"
strSQL = strSQL & request.form("chk1stHotelPref" & ","
strSQL = strSQL & request.form("chk1stCar" & ",'"
strSQL = strSQL & request.form("1st_atxtDate" & "','"
strSQL = strSQL & request.form("1st_acboTime" &" "& request.form("1st_acboSetting" & "','"
strSQL = strSQL & request.form("1st_atxtCity" & "','"
strSQL = strSQL & request.form("1st_atxtAddress" & "','"
strSQL = strSQL & request.form("1st_btxtDate" & "','"
strSQL = strSQL & request.form("1st_bcboTime" &" "& request.form("1st_bcboSetting" & "','"
strSQL = strSQL & request.form("1st_btxtCity" & "','"
strSQL = strSQL & request.form("1st_btxtAddress" & "','"
strSQL = strSQL & request.form("txt2ndDepartureCity" & "','"
strSQL = strSQL & request.form("txt2ndDepartureCode" & "',"
strSQL = strSQL & request.form("chk2ndAirTravel" & ",'"
strSQL = strSQL & request.form("cbo2ndDeparturePreference" & "',"
strSQL = strSQL & request.form("chk2ndHotelPref" & ","
strSQL = strSQL & request.form("chk2ndCar" & ",'"
strSQL = strSQL & request.form("2nd_atxtDate" & "','"
strSQL = strSQL & request.form("2nd_acboTime" &" "& request.form("2nd_acboSetting" & "','"
strSQL = strSQL & request.form("2nd_atxtCity" & "','"
strSQL = strSQL & request.form("2nd_atxtAddress" & "','"
strSQL = strSQL & request.form("2nd_btxtDate" & "','"
strSQL = strSQL & request.form("2nd_bcboTime" &" "& request.form("2nd_bcboSetting" & "','"
strSQL = strSQL & request.form("2nd_btxtCity" & "','"
strSQL = strSQL & request.form("2nd_btxtAddress" & "','"
strSQL = strSQL & request.form("txt3rdDepartureCity" & "','"
strSQL = strSQL & request.form("txt3rdDepartureCode" & "',"
strSQL = strSQL & request.form("chk3rdAirTravel" & ",'"
strSQL = strSQL & request.form("cbo3rdDeparturePreference" & "',"
strSQL = strSQL & request.form("chk3rdHotelPref" & ","
strSQL = strSQL & request.form("chk3rdCar" & ",'"
strSQL = strSQL & request.form("3rd_atxtDate" & "','"
strSQL = strSQL & request.form("3rd_acboTime" &" "& request.form("3rd_acboSetting" & "','"
strSQL = strSQL & request.form("3rd_atxtCity" & "','"
strSQL = strSQL & request.form("3rd_atxtAddress" & "','"
strSQL = strSQL & request.form("3rd_btxtDate" & "','"
strSQL = strSQL & request.form("3rd_bcboTime" &" "& request.form("3rd_bcboSetting" & "','"
strSQL = strSQL & request.form("3rd_btxtCity" & "','"
strSQL = strSQL & request.form("3rd_btxtAddress" & "','"
strSQL = strSQL & request.form("txt4thDepartureCity" & "','"
strSQL = strSQL & request.form("txt4thDepartureCode" & "',"
strSQL = strSQL & request.form("chk4thAirTravel" & ",'"
strSQL = strSQL & request.form("cbo4thDeparturePreference" & "',"
strSQL = strSQL & request.form("chk4thHotelPref" & ","
strSQL = strSQL & request.form("chk4thCar" & ",'"
strSQL = strSQL & request.form("4th_atxtDate" & "','"
strSQL = strSQL & request.form("4th_acboTime" &" "& request.form("2nd_acboSetting" & "','"
strSQL = strSQL & request.form("4th_atxtCity" & "','"
strSQL = strSQL & request.form("4th_atxtAddress" & "','"
strSQL = strSQL & request.form("4th_btxtDate" & "','"
strSQL = strSQL & request.form("4th_bcboTime" &" "& request.form("2nd_bcboSetting" & "','"
strSQL = strSQL & request.form("4th_btxtCity" & "','"
strSQL = strSQL & request.form("4th_btxtAddress" & "')"
response.write strSQL
Set oConnStatus = server.createobject("adodb.connection"
oConnStatus.Open strconn
oConnStatus.execute(strSQL)
response.redirect "ReviewRequest.asp"
set oConnStatus = nothing
%> Paul
paul_wilson74@hotmail.com
<!--#include file="Conn.asp"-->
<%
dim strSQL
strSQL ="INSERT INTO Request(Request_Date,Request_Time,Employee_ID,Employee_Name,Employee_Status,"&_
"Employee_Department,Airline_Preference,Departure_City,Departure_Code,Departure_Date,Departure_Time, "&_
"1st_DepartureCity,1st_DepartureCode,1st_DepartureAirTravel,1st_AirPreference,1st_Hotel,1st_Car, "&_
"1st_aDate,1st_aTime,1st_aCity,1st_aAddress,1st_bDate,1st_bTime,1st_bCity,1st_bAddress, "&_
"2nd_DepartureCity,2nd_DepartureCode,2nd_DepartureAirTravel,2nd_AirPreference,2nd_Hotel,2nd_Car, "&_
"2nd_aDate,2nd_aTime,2nd_aCity,2nd_aAddress,2nd_bDate,2nd_bTime,2nd_bCity,2nd_bAddress, "&_
"3rd_DepartureCity,3rd_DepartureCode,3rd_DepartureAirTravel,3rd_AirPreference,3rd_Hotel,3rd_Car, "&_
"3rd_aDate,3rd_aTime,3rd_aCity,3rd_aAddress,3rd_bDate,3rd_bTime,3rd_bCity,3rd_bAddress, "&_
"4th_DepartureCity,4th_DepartureCode,4th_DepartureAirTravel,4th_AirPreference,4th_Hotel,4th_Car, "&_
"4th_aDate,4th_aTime,4th_aCity,4th_aAddress,4th_bDate,4th_bTime,4th_bCity,4th_bAddress)"
strSQL = strSQL & "VALUES('"& request.form("txtDate" &"','"
strSQL = strSQL & request.form("txtTime" & "','"
strSQL = strSQL & request.form("txtEmployeeID" & "','"
strSQL = strSQL & request.form("txtEmployeeName" & "','"
strSQL = strSQL & request.form("txtEmployeeStatus" & "','"
strSQL = strSQL & request.form("txtEmployeeDepartment" & "','"
strSQL = strSQL & request.form("txtAirlinePreference" & "','"
strSQL = strSQL & request.form("txtDepartureCity" & "','"
strSQL = strSQL & request.form("txtDeptCode" & "','"
strSQL = strSQL & request.form("txtDepartureDate" & "','"
strSQL = strSQL & request.form("cboDepartureTime" &" "& request.form("cboTime" & "','"
strSQL = strSQL & request.form("txt1stDepartureCity" & "','"
strSQL = strSQL & request.form("txt1stDepartureCode" & "',"
strSQL = strSQL & request.form("chk1stAirTravel" & ",'"
strSQL = strSQL & request.form("cbo1stDeparturePreference" & "',"
strSQL = strSQL & request.form("chk1stHotelPref" & ","
strSQL = strSQL & request.form("chk1stCar" & ",'"
strSQL = strSQL & request.form("1st_atxtDate" & "','"
strSQL = strSQL & request.form("1st_acboTime" &" "& request.form("1st_acboSetting" & "','"
strSQL = strSQL & request.form("1st_atxtCity" & "','"
strSQL = strSQL & request.form("1st_atxtAddress" & "','"
strSQL = strSQL & request.form("1st_btxtDate" & "','"
strSQL = strSQL & request.form("1st_bcboTime" &" "& request.form("1st_bcboSetting" & "','"
strSQL = strSQL & request.form("1st_btxtCity" & "','"
strSQL = strSQL & request.form("1st_btxtAddress" & "','"
strSQL = strSQL & request.form("txt2ndDepartureCity" & "','"
strSQL = strSQL & request.form("txt2ndDepartureCode" & "',"
strSQL = strSQL & request.form("chk2ndAirTravel" & ",'"
strSQL = strSQL & request.form("cbo2ndDeparturePreference" & "',"
strSQL = strSQL & request.form("chk2ndHotelPref" & ","
strSQL = strSQL & request.form("chk2ndCar" & ",'"
strSQL = strSQL & request.form("2nd_atxtDate" & "','"
strSQL = strSQL & request.form("2nd_acboTime" &" "& request.form("2nd_acboSetting" & "','"
strSQL = strSQL & request.form("2nd_atxtCity" & "','"
strSQL = strSQL & request.form("2nd_atxtAddress" & "','"
strSQL = strSQL & request.form("2nd_btxtDate" & "','"
strSQL = strSQL & request.form("2nd_bcboTime" &" "& request.form("2nd_bcboSetting" & "','"
strSQL = strSQL & request.form("2nd_btxtCity" & "','"
strSQL = strSQL & request.form("2nd_btxtAddress" & "','"
strSQL = strSQL & request.form("txt3rdDepartureCity" & "','"
strSQL = strSQL & request.form("txt3rdDepartureCode" & "',"
strSQL = strSQL & request.form("chk3rdAirTravel" & ",'"
strSQL = strSQL & request.form("cbo3rdDeparturePreference" & "',"
strSQL = strSQL & request.form("chk3rdHotelPref" & ","
strSQL = strSQL & request.form("chk3rdCar" & ",'"
strSQL = strSQL & request.form("3rd_atxtDate" & "','"
strSQL = strSQL & request.form("3rd_acboTime" &" "& request.form("3rd_acboSetting" & "','"
strSQL = strSQL & request.form("3rd_atxtCity" & "','"
strSQL = strSQL & request.form("3rd_atxtAddress" & "','"
strSQL = strSQL & request.form("3rd_btxtDate" & "','"
strSQL = strSQL & request.form("3rd_bcboTime" &" "& request.form("3rd_bcboSetting" & "','"
strSQL = strSQL & request.form("3rd_btxtCity" & "','"
strSQL = strSQL & request.form("3rd_btxtAddress" & "','"
strSQL = strSQL & request.form("txt4thDepartureCity" & "','"
strSQL = strSQL & request.form("txt4thDepartureCode" & "',"
strSQL = strSQL & request.form("chk4thAirTravel" & ",'"
strSQL = strSQL & request.form("cbo4thDeparturePreference" & "',"
strSQL = strSQL & request.form("chk4thHotelPref" & ","
strSQL = strSQL & request.form("chk4thCar" & ",'"
strSQL = strSQL & request.form("4th_atxtDate" & "','"
strSQL = strSQL & request.form("4th_acboTime" &" "& request.form("2nd_acboSetting" & "','"
strSQL = strSQL & request.form("4th_atxtCity" & "','"
strSQL = strSQL & request.form("4th_atxtAddress" & "','"
strSQL = strSQL & request.form("4th_btxtDate" & "','"
strSQL = strSQL & request.form("4th_bcboTime" &" "& request.form("2nd_bcboSetting" & "','"
strSQL = strSQL & request.form("4th_btxtCity" & "','"
strSQL = strSQL & request.form("4th_btxtAddress" & "')"
response.write strSQL
Set oConnStatus = server.createobject("adodb.connection"
oConnStatus.Open strconn
oConnStatus.execute(strSQL)
response.redirect "ReviewRequest.asp"
set oConnStatus = nothing
%> Paul
paul_wilson74@hotmail.com