SQL - missing coma

R

Red_Star20

I have a form that submits data into an oracle database and i am getting an
error, but not all the time....

Error msg:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Oracle][ODBC][Ora]ORA-00917: missing comma

here is my code:

strSQL = "INSERT INTO student_data
(bannerid,lastname,firstname,sex,birthday,citizen,major,credithours,gpa,dorm,second_language,localaddress,localapt,localcity,localstate,localzipcode,localphonenumber,cellphonenumber,email,permanentaddress,permanentcity,permanentstate,permanentzip,permanentphonenumber,overseasexperience,reasonstotravel,choice1,choice2,choice3,choice4,choice5,choice6,choice7,Ec_Name,Ec_Relationship,Ec_Address,Ec_City,Ec_State,Ec_Zip,Ec_HomePhone,Ec_HomeCellPhone,Tuition_Type,Submit_Date,choice1_status,choice2_status,choice3_status,choice4_status,choice5_status,choice6_status,choice7_status,comfort_zone,food,behavior,class_choice,class_choice1,InfoSession,EC_Country,PermanentCountry)
VALUES ('" & bannerid & "','" & lastname & "','" & firstname & "','" & sex &
"',TO_DATE('" & birthday & "','MM/DD/YYYY'),'" & citizen & "','" & major &
"'," & credithours & ",'" & gpa & "','" & campusmail & "','" &
second_language & "','" & localaddress & "','" & localapt & "','" & localcity
& "','" & localstate & "'," & localzipcode & ",'" & localphonenumber & "','"
& cellphonenumber & "','" & email & "','" & permanentaddress & "','" &
permanentcity & "','" & permanentstate & "'," & permanentzipcode & ",'" &
permanentphonenumber & "','" & overseasexp & "','" & reasonstotravel & "','"
& choice1 & "','" & choice2 &"','" & choice3 &"','" & choice4 &"','" &
choice5 &"','" & choice6 &"','" & choice7 &"','" & Ec_Name & "','" &
Ec_Relationship & "','" & Ec_Address & "','" & Ec_City & "','" & Ec_State &
"'," & Ec_Zip & ",'" & Ec_HomePhone & "','" & Ec_HomeCellPhone & "','" &
Tuition_Type & "',TO_DATE('" & Date_Submitted & "','MM/DD/YYYY'),'" &
choice1_status & "','" & choice2_status & "','" & choice3_status & "','" &
choice4_status & "','" & choice5_status & "','" & choice6_status & "','" &
choice7_status & "','" & comfort_zone & "','" & food & "','" & behavior &
"','" & class_choice & "','" & class_choice1 & "','" & InfoSession & "','" &
EC_Country & "','" & Permanent_Country & "')"

dbConnection.execute(strSQL)


Any ideas as to what can be causing this error?

I
 
K

Kevin Spencer

It would help if you commented out the "dbConnection.execute(strSQL)" line,
and replaced it temporarily with:

Response.Write(strSQL)

This will write out the SQL to your page, so that you can see it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
I'd rather be a hammer than a nail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top