This topic is locked
[SOLVED]

 Login page Error

1/24/2015 11:27:58 AM
ASPRunnerPro General questions
K
kleanthis author

In the login page I have for username and password numbers (SQL data type: int).

When I enter wrong number works fine, but when I enter characters for username I get the following error.
Microsoft SQL Server Native Client 10.0 error '80040e07'
Conversion failed when converting the nvarchar value 'kk' to data type int.
/login.asp, line 0


Can anyone help me.
Thanks Kleanthis

acaruson 1/24/2015



In the login page I have for username and password numbers (SQL data type: int).

When I enter wrong number works fine, but when I enter characters for username I get the following error.
Microsoft SQL Server Native Client 10.0 error '80040e07'
Conversion failed when converting the nvarchar value 'kk' to data type int.
/login.asp, line 0


Can anyone help me.
Thanks Kleanthis


So your LOGIN and PASSWORD fields are set as an integer?
Traditionally, I've always made them vchar or some other short text field. Even if LOGIN is always going to be a number, I still store the value as text...but use validation to ensure the user enters a numeric value.
Is there a particular need to store user credentials as an integer? You might try making both the LOGIN and PASSWORD fields vchar or some other short text based value.

K
kleanthis author 1/25/2015

it a solution but I wonder if there is a bug in the asprunner 9.0?

acaruson 1/25/2015



it a solution but I wonder if there is a bug in the asprunner 9.0?


I don't think it's a bug per se. I've just never seen it work with integers. My guess is the query that tests the values is looking for text.

admin 1/29/2015

This behaviour is by design. SQL Server is trying to convert your username or password 'kk' into integer and cannot do that.
The solution is to use text field for username/password purposes.