rigpig
Jan 5th, 2001, 11:42 AM
I have a table called used_cars and have a drop down called sub model that is hard coded with all the sub models available sow how do you update the dB? the values are being save into a table called used_category field name description?
this is the start of my SQL
If Request.Form("save")="save" then
If VehicleID = 0 Then
strSQL = "Insert Into used_cars (CategoryID, year, make, model, kms, stocknumber, color, price, enginesize, additional, seatingcapacity,submodel) values ("
strSQL = strSQL & CategoryID & ","
strSQL = strSQL & Request.Form("year") & ","
continue strSQL for make,model etc.
strSQL = strSQL & AddSQLQuotes(Request.Form("submodel"), "'") & ")"
this is JUST an example of my drop down
<select name="submodel">
option value="base" selected>Base</option>
<option value="Cargo">Cargo</option>
<option value="CL">CL</option>
</select>
and finally this is my error message
Microsoft OLE DB Provider for SQL Server error ' 80040e14'
There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
/test/newlayout2.asp, line 64
line 64 is this dbData.Execute strSQL
do i have to insert every single submodel of every single model of car??? is there not an easier way of doing this?
how do i make sure when i want to edit the record the proper dropdown value is listed???
this is the start of my SQL
If Request.Form("save")="save" then
If VehicleID = 0 Then
strSQL = "Insert Into used_cars (CategoryID, year, make, model, kms, stocknumber, color, price, enginesize, additional, seatingcapacity,submodel) values ("
strSQL = strSQL & CategoryID & ","
strSQL = strSQL & Request.Form("year") & ","
continue strSQL for make,model etc.
strSQL = strSQL & AddSQLQuotes(Request.Form("submodel"), "'") & ")"
this is JUST an example of my drop down
<select name="submodel">
option value="base" selected>Base</option>
<option value="Cargo">Cargo</option>
<option value="CL">CL</option>
</select>
and finally this is my error message
Microsoft OLE DB Provider for SQL Server error ' 80040e14'
There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
/test/newlayout2.asp, line 64
line 64 is this dbData.Execute strSQL
do i have to insert every single submodel of every single model of car??? is there not an easier way of doing this?
how do i make sure when i want to edit the record the proper dropdown value is listed???