|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Sql!!
hi.. i have a problem with a insert statement.. can anyone here? e error is INSERT INTO SYntax error.. pls help.. thanks..
code: sql = "INSERT INTO schooldirectory (schoolcode, zone, schoolname, address, principal, viceprincipal, telephone, fax, status) VALUES ('" & Request.Form("schoolcode") & "', '" & Request.Form("zone") & "', '" & Request.Form("schoolname") & "','" & Request.Form("address") & "','" & Request.Form("principal") & "','" & Request.Form("viceprincipal") & "'," & Request.Form("telephone") & ", " & Request.Form("fax") & ",'" & Request.Form("status") & "')" conn.Execute sql |
|
#2
|
|||
|
|||
|
What programing language are using to interface with you DB (from another post I am assuming your DB is MS Access)?
S- |
|
#3
|
|||
|
|||
|
ya
ya.. i'm using ms access...
|
|
#4
|
|||
|
|||
|
using asp ....
|
|
#5
|
|||
|
|||
|
At the core, the Insert statment looks correct, but I don't know enought about how asp references text boxes on it forms, to know if your referencing is incorrect.
You are missing the ";" at the end of your statement, but access typically doesn't care. Also are your fax and telephone fields numeric or text data types (no single quotes included in your statement) Hope this helps S- |
|
#6
|
|||
|
|||
|
Missing or incorrect form data is often a problem. For debugging, you can put
response.write sql response.end above the execute statement to inspect the sql string in your browser. |
|
#7
|
|||
|
|||
|
anything else tat could b wrong? i debugged it le.. seems ok to me.. but nt in my asp..
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Sql!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|