Print Page | Close Window

SQL Problems

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8510
Printed Date: 01 April 2026 at 7:19am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL Problems
Posted By: twooly
Subject: SQL Problems
Date Posted: 02 January 2004 at 10:31pm

Having a small problem with a SQL statement and was hoping someone could help out. 

Thanks

This is the error I get:

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

 

Code:

 strUserName = Session("userName")

 Set rsEmail = Server.CreateObject("ADODB.Recordset")

 strSQL = "SELECT email, username FROM tblUsers Where username = " & strUserName

 rsEmail.Open strSQL, adoCon

 

 

The strUserName is correct I checked that with a Response.Write.  don't know if this helps but username isn't the first column or the primary key but there can't be two of the same usernames in that column.




Replies:
Posted By: twooly
Date Posted: 02 January 2004 at 11:12pm
Nevermind I got it figured out.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net