Hello
On my page here: Displaying all records from a database table I am getting the following error:
Line 112 is this:
The error message occurs when I deliberately leave all fields blank on my online 'Add Records' form and press 'submit'. This is a MS Access db and wolf ID has a 'Number' data type.
The code I have is:
I have tried debugging using:
but I don't get any results (please see screenshot).
What might be the best way to remove that error, please?
Thanks!
On my page here: Displaying all records from a database table I am getting the following error:
Quote:
Microsoft VBScript runtime error '800a000d' Type mismatch: 'CDBL' /addRecords.asp, line 112 |
Code:
my_wolfID = CDBL( Request.Form("wolfID") )
The code I have is:
Code:
Dim conn, rs, my_fullName, my_wolfID, my_telNo, my_address, my_email, my_description, my_received, my_action, my_dispatched
' set varaible values from request.form
my_fullName = Replace( Request.Form("fullName"), "'", "''" )
my_wolfID = CDBL( Request.Form("wolfID") )
my_telNo = CDBL( Request.Form("telNo") )
my_address = Replace( Request.Form("address"), "'", "''" )
my_email = Replace( Request.Form("email"), "'", "''" )
my_description = Replace( Request.Form("description"), "'", "''" )
my_received = CDATE( Request.Form("received") )
my_action = Replace( Request.Form("action"), "'", "''" )
my_dispatched = Replace( Request.Form("dispatched"), "'", "''" )
'build insert statement
sSQL="INSERT INTO tblWolf " &_
"(fullName, wolfID, telNo, address, email, description, received, [action], dispatched)" &_
" VALUES ('" & my_fullName & "', " & my_wolfID & ", " & my_telNo & ", '" & my_address & "', '" & my_email & "', '" & my_description & "', #" & my_received & "#, '" & my_action & "', '" & my_dispatched & "')"
Code:
Response.Write "<hr/>DEBUG SQL:<br/>" & sSQL & "<hr/>" & vbNewLine
What might be the best way to remove that error, please?
Thanks!