Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP web login code / SQL server datatype issue

Status
Not open for further replies.

MavrickStl

Programmer
Feb 20, 2001
71
US
This is a part of my code of ASP login script:

myname=request.form("Userid")

sqltemp="select * from tblsecurity WHERE Userid= '"
sqltemp=sqltemp & myname & "'"

I am using SQL server database:

UserID Text
Password Text


I am getting this ASP error when I run the script:

The text, ntext, and image data types cannot be used in the WHERE, HAVING, or ON clause, except with the LIKE or IS NULL predicates.

Guys,

I need to know why Ii can not select userid as text and compare it with the form input. Please help....

thanks, A
 
Hi,
There is a workaround of your problem:

Set the type of columns as varchar
then the asp code will be the same

Hope this helps
D
 
In SQLServer, Text is a 'blob' column type - i.e. for huge volumes of data. It is similar to the binary column type - except that the intention is that text it to be stored.

For historical, rather than for sensible, reasons BLOB columns such as 'text' are not easily searchable (or anything else for that matter). So like the first response to your query, you will need to convert these columns to varchar (plain ASCII text) or nvarchar (Unicode - all foreign character sets - each character takes 2 bytes) columns.

varchar can go up to 8000 characters, and nvarchar up to 4000 - which I think is probably quite generous for a user ID and Password!
(Content Management)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top