fejl i INSERT INTO
Hey EASP/IIS/ACCESS/IE
jeg får en fejl i denne SQL sætning:
SQL = "INSERT INTO aircraft ("
for each x in rs.fields
if x.name <> "aircraft_id" then
if Request.Form("" & x.name) <> "" then
SQL = SQL & x.name &","
end if
end if
next
SQL = left(SQL, len(SQL) -1)
SQL = SQL & ") VALUE ("
for each x in rs.fields
if x.name <> "aircraft_id" then
if Request.Form("" & x.name) <> "" then
SQL = SQL & Request.Form("" & x.name) & ","
end if
end if
next
SQL = left(SQL, len(SQL) -1)
SQL = SQL & ")"
' response.Write(SQL)
rsConn.EXECUTE(SQL)
hvis jeg udskriver ovenstående fåes:
INSERT INTO aircraft (ac_base,ac_country,ac_type,ac_name,ac_statusnr) VALUE (1,1,1,1,1)
jeg kan ikke se nogen fejl i udskriften, kan i?
jeg forsøger at efterligne dette kodeopsæt:
'sql="INSERT INTO customers (customerID,companyname,"
'sql=sql & "contactname,address,city,postalcode,country)"
'sql=sql & " VALUES "
'sql=sql & "('" & Request.Form("custid") & "',"
'sql=sql & "'" & Request.Form("compname") & "',"
'sql=sql & "'" & Request.Form("contname") & "',"
'sql=sql & "'" & Request.Form("address") & "',"
'sql=sql & "'" & Request.Form("city") & "',"
'sql=sql & "'" & Request.Form("postcode") & "',"
'sql=sql & "'" & Request.Form("country") & "')"
'conn.Execute sql
