Copy link to clipboard
Copied
I am currently working through the book "Adobe Dreamweaver CS3: Training From the Source. I am working on Chapter 15 using ASP and would be grateful if somebody could point out what the code should be.
The error message I get is :
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'CLng'
/newland/admin_cp_update_processor.asp, line 32
The relevant code is:
<%
'Create connection object
Dim dbConn
Dim rs_regions
set dbConn = server.CreateObject("adodb.connection")
'Connect to database via DSN
dbConn.open("newland")
Dim countryID_cleaned, region_cleaned, countryName_cleaned, population_cleaned, country_currency_cleaned, description_cleaned, imageURL_cleaned, imageALT_cleaned
countryID_cleaned = CLng(Request.Form("countryID"))
region_cleaned = CLng(Request.Form("region"))
countryName_cleaned = Replace(Request.Form("countryName"),"'","''")
population_cleaned = Replace(Request.Form("population"),"'","''")
country_currency_cleaned = Replace(Request.Form("country_currency"),"'","''")
description_cleaned = Replace(Request.Form("description"),"'","''")
imageURL_cleaned = Replace(Request.Form("imageURL"),"'","''")
imageALT_cleaned = Replace(Request.Form("imageALT"),"'","''")
dbConn.Execute("UPDATE tbl_country SET region='" & region_cleaned & "', countryName='" & countryName_cleaned & "', population='" & population_cleaned & "', country_currency='" & country_currency_cleaned & "', description='" & description_cleaned & "', imageURL='" & imageURL_cleaned & "', imageALT='" & imageALT_cleaned & "' WHERE countryID=" & countryID_cleaned)
Response.Redirect("admin_cp_master.asp")
%>
Line 32 of the code is: countryID_cleaned = CLng(Request.Form("countryID"))
Regards
David
Copy link to clipboard
Copied
What type of value is in Request.Form("countryID") ? How is it being populated? Can you show us the form.
Copy link to clipboard
Copied

The form is shown above. Employees can update country profiles. I hope this helps!
Regards
David
Copy link to clipboard
Copied
Screenshots don't help. We need to see the code. Is countryID guaranteed to always be numeric?
Copy link to clipboard
Copied
Thanks for your time. I have found the typo that caused the error now.
Regards
David
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more