leeboycymru
Programmer
I keep getting this error:
Number of query values and destination fields are not the same.
I cant seem to find the problem, here is my code:
<% Server.ScriptTimeout = 360 %>
<%
FUNCTION fixQuotes ( theString )
fixQuotes = REPLACE( theString, "'", "''" )
END FUNCTION
set connM = server.createobject("ADODB.Connection")
connM.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("..\db_import\EventStyle.mdb")
if instr(Trim(Request.ServerVariables("HTTP_REFERER")),"addproduct_art.asp") or instr(Trim(Request.ServerVariables("HTTP_REFERER")),"updateproduct_art.asp") then
Set Upload = Server.CreateObject("Persits.Upload")
theCount = upload.save(server.mappath("..")&"\images\uploaded")
For Each File in Upload.Files
filename = File.FileName
Next
'Count = Upload.SaveVirtual("../upload")
' Get the form variables
addProduct = TRIM (Upload.Form("addProduct"))
updateProduct = TRIM (Upload.Form("updateProduct"))
deleteProduct = TRIM (Upload.Form("deleteProduct"))
'response.write("delete=" & deleteProduct)
delID = TRIM (Upload.Form("delID"))
catID = TRIM (Upload.Form("catID"))
artTitle = TRIM (Upload.Form("artTitle"))
artCategory = TRIM (Upload.Form("artCategory"))
artBriefDesc = TRIM (Upload.Form("artBriefDesc"))
artPrice = TRIM (Upload.Form("artPrice"))
artPicFull = TRIM (filename)
artHood = TRIM (filename)
artFace = TRIM (filename)
artCaseDesc = TRIM (Upload.Form("artCaseDesc"))
artDialDesc = TRIM (Upload.Form("artDialDesc"))
artMovementDesc = TRIM (Upload.Form("artMovementDesc"))
artMakerDesc = TRIM (Upload.Form("artMakerDesc"))
artDateDesc = TRIM (Upload.Form("artDateDesc"))
artHeightDesc = TRIM (Upload.Form("artHeightDesc"))
artMoonDisplay = TRIM (Upload.Form("artMoonDisplay"))
artStatus = TRIM (Upload.Form("artStatus"))
artDisplay = TRIM (Upload.Form("artDisplay"))
origImage = TRIM(upload.Form("origImage"))
origHImage = TRIM(upload.Form("origHImage"))
origFImage = TRIM(upload.Form("origFImage"))
set upload = nothing
'response.write("CATID=" & catID)
'Assign Default Values
IF artTitle = "" THEN
artTitle = "?????"
END IF
IF artCategory = "" THEN
artCategory = "?????"
END IF
IF artBriefDesc = "" THEN
artBriefDesc = "?????"
END IF
IF artPrice = "" THEN
artPrice = "?????"
END IF
IF artCaseDesc = "" THEN
artCaseDesc = "?????"
END IF
IF artDialDesc = "" THEN
artDialDesc = "?????"
END IF
IF artMovementDesc = "" THEN
artMovementDesc = "?????"
END IF
IF artMakerDesc = "" THEN
artMakerDesc = "?????"
END IF
IF artDateDesc = "" THEN
artDateDesc = "?????"
END IF
IF artHeightDesc = "" THEN
artHeightDesc = "?????"
END IF
IF artMoonDisplay = "" THEN
artMoonDisplay = "?????"
END IF
IF artStatus = "" THEN
artStatus = "?????"
END IF
IF artDisplay = "" THEN
artDisplay = "?????"
END IF
' Add new product
if artPicFull = "" then
Pimage = origImage
else
Pimage = artPicFull
end if
if artHood = "" then
Himage = origHImage
else
Himage = artHood
end if
if artFace = "" then
Fimage = origFImage
else
Fimage = artFace
end if
if addProduct <> "" then
strsqlM = "INSERT INTO eventDisplay " &_
"( art_Title, art_Category, art_BDescription, art_Price, art_ThumbFull, art_ThumbHood, art_ThumbFace, case_Text, dial_Text, movement_Text, maker_Text, date_Text, height_Text, art_Status, art_Display, art_MoonDisplay ) VALUES (" &_
" '" & fixQuotes (artTitle ) & "', " &_
" '" & fixQuotes (artCategory ) & "', " &_
" '" & fixQuotes (artBriefDesc ) & "', " &_
" '" & fixQuotes (artPrice ) & "', " &_
" '" & fixQuotes (artPicFull ) & "' )" &_
" '" & fixQuotes (artHood ) & "' )" &_
" '" & fixQuotes (artFace ) & "' )" &_
" '" & fixQuotes (artCaseDesc ) & "', " &_
" '" & fixQuotes (artDialDesc ) & "', " &_
" '" & fixQuotes (artMovementDesc ) & "', " &_
" '" & fixQuotes (artMakerDesc ) & "', " &_
" '" & fixQuotes (artDateDesc ) & "', " &_
" '" & fixQuotes (artHeightDesc ) & "', " &_
" '" & fixQuotes (artMoonDisplay ) & "', " &_
" '" & fixQuotes (artStatus ) & "', " &_
" '" & fixQuotes (artDisplay ) & "', "
'rsuser.open strsql, conn
ConnM.Execute strsqlM
end if
%>
Number of query values and destination fields are not the same.
I cant seem to find the problem, here is my code:
<% Server.ScriptTimeout = 360 %>
<%
FUNCTION fixQuotes ( theString )
fixQuotes = REPLACE( theString, "'", "''" )
END FUNCTION
set connM = server.createobject("ADODB.Connection")
connM.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("..\db_import\EventStyle.mdb")
if instr(Trim(Request.ServerVariables("HTTP_REFERER")),"addproduct_art.asp") or instr(Trim(Request.ServerVariables("HTTP_REFERER")),"updateproduct_art.asp") then
Set Upload = Server.CreateObject("Persits.Upload")
theCount = upload.save(server.mappath("..")&"\images\uploaded")
For Each File in Upload.Files
filename = File.FileName
Next
'Count = Upload.SaveVirtual("../upload")
' Get the form variables
addProduct = TRIM (Upload.Form("addProduct"))
updateProduct = TRIM (Upload.Form("updateProduct"))
deleteProduct = TRIM (Upload.Form("deleteProduct"))
'response.write("delete=" & deleteProduct)
delID = TRIM (Upload.Form("delID"))
catID = TRIM (Upload.Form("catID"))
artTitle = TRIM (Upload.Form("artTitle"))
artCategory = TRIM (Upload.Form("artCategory"))
artBriefDesc = TRIM (Upload.Form("artBriefDesc"))
artPrice = TRIM (Upload.Form("artPrice"))
artPicFull = TRIM (filename)
artHood = TRIM (filename)
artFace = TRIM (filename)
artCaseDesc = TRIM (Upload.Form("artCaseDesc"))
artDialDesc = TRIM (Upload.Form("artDialDesc"))
artMovementDesc = TRIM (Upload.Form("artMovementDesc"))
artMakerDesc = TRIM (Upload.Form("artMakerDesc"))
artDateDesc = TRIM (Upload.Form("artDateDesc"))
artHeightDesc = TRIM (Upload.Form("artHeightDesc"))
artMoonDisplay = TRIM (Upload.Form("artMoonDisplay"))
artStatus = TRIM (Upload.Form("artStatus"))
artDisplay = TRIM (Upload.Form("artDisplay"))
origImage = TRIM(upload.Form("origImage"))
origHImage = TRIM(upload.Form("origHImage"))
origFImage = TRIM(upload.Form("origFImage"))
set upload = nothing
'response.write("CATID=" & catID)
'Assign Default Values
IF artTitle = "" THEN
artTitle = "?????"
END IF
IF artCategory = "" THEN
artCategory = "?????"
END IF
IF artBriefDesc = "" THEN
artBriefDesc = "?????"
END IF
IF artPrice = "" THEN
artPrice = "?????"
END IF
IF artCaseDesc = "" THEN
artCaseDesc = "?????"
END IF
IF artDialDesc = "" THEN
artDialDesc = "?????"
END IF
IF artMovementDesc = "" THEN
artMovementDesc = "?????"
END IF
IF artMakerDesc = "" THEN
artMakerDesc = "?????"
END IF
IF artDateDesc = "" THEN
artDateDesc = "?????"
END IF
IF artHeightDesc = "" THEN
artHeightDesc = "?????"
END IF
IF artMoonDisplay = "" THEN
artMoonDisplay = "?????"
END IF
IF artStatus = "" THEN
artStatus = "?????"
END IF
IF artDisplay = "" THEN
artDisplay = "?????"
END IF
' Add new product
if artPicFull = "" then
Pimage = origImage
else
Pimage = artPicFull
end if
if artHood = "" then
Himage = origHImage
else
Himage = artHood
end if
if artFace = "" then
Fimage = origFImage
else
Fimage = artFace
end if
if addProduct <> "" then
strsqlM = "INSERT INTO eventDisplay " &_
"( art_Title, art_Category, art_BDescription, art_Price, art_ThumbFull, art_ThumbHood, art_ThumbFace, case_Text, dial_Text, movement_Text, maker_Text, date_Text, height_Text, art_Status, art_Display, art_MoonDisplay ) VALUES (" &_
" '" & fixQuotes (artTitle ) & "', " &_
" '" & fixQuotes (artCategory ) & "', " &_
" '" & fixQuotes (artBriefDesc ) & "', " &_
" '" & fixQuotes (artPrice ) & "', " &_
" '" & fixQuotes (artPicFull ) & "' )" &_
" '" & fixQuotes (artHood ) & "' )" &_
" '" & fixQuotes (artFace ) & "' )" &_
" '" & fixQuotes (artCaseDesc ) & "', " &_
" '" & fixQuotes (artDialDesc ) & "', " &_
" '" & fixQuotes (artMovementDesc ) & "', " &_
" '" & fixQuotes (artMakerDesc ) & "', " &_
" '" & fixQuotes (artDateDesc ) & "', " &_
" '" & fixQuotes (artHeightDesc ) & "', " &_
" '" & fixQuotes (artMoonDisplay ) & "', " &_
" '" & fixQuotes (artStatus ) & "', " &_
" '" & fixQuotes (artDisplay ) & "', "
'rsuser.open strsql, conn
ConnM.Execute strsqlM
end if
%>