Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Type mismatch: 'CDBL' error

$
0
0
Hello

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
Line 112 is this:
Code:

my_wolfID = CDBL( Request.Form("wolfID") )
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:

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 & "')"

I have tried debugging using:
Code:

Response.Write "<hr/>DEBUG SQL:<br/>" & sSQL & "<hr/>" & vbNewLine
but I don't get any results (please see screenshot).

What might be the best way to remove that error, please?

Thanks!

Attached Images
File Type: jpg DB_screenshot.jpg (25.6 KB)

Viewing all articles
Browse latest Browse all 13329

Trending Articles