Wrox Programmer Forums
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 16th, 2007, 08:29 AM
Authorized User
 
Join Date: Jan 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default SELECT FROM help

Hi everyone,
I am new to this group so if I have missed the answer to this question I am sorry.

I have a login page using an access database to verify username.

when I use the like statement it returns the correct data but I need it to =the username in the table.

this is the code:

qry = "SELECT * FROM userlist WHERE username = '" & Request.Form("txtUserName") & "%'"


Set oRS = oConn.Execute(qry)

if not oRS.EOF then
while not oRS.EOF
response.write ("Welcome. "& oRs.Fields(username) & " <br>")

oRS.movenext
wend
else response.Write("Username not found.")
oRS.close
end if

Can someone help me with this please?
Thanks,
Dink
 
Old January 16th, 2007, 09:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...

try this (just take out the %)

Code:
qry = "SELECT * FROM userlist WHERE username = '" & Request.Form("txtUserName") & "'"
HTH

Gonzalo
 
Old January 16th, 2007, 02:21 PM
Authorized User
 
Join Date: Jan 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Gonzalo this worked gret!!! thank you very much!
dink






Similar Threads
Thread Thread Starter Forum Replies Last Post
Select row in GridView WITHOUT using Select button rao965 ASP.NET 2.0 Professional 1 February 15th, 2008 10:44 AM
Select from another select statement to a repeater simsen ASP.NET 2.0 Professional 0 May 2nd, 2007 04:34 PM
Fill select box and select recordset value markd Classic ASP Databases 1 February 20th, 2006 06:41 PM
select="node1", select="node2"... Baldo XSLT 7 March 12th, 2004 10:38 AM
Select Within A Select Problem vinyl-junkie Classic ASP Databases 6 June 7th, 2003 04:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.