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

You are currently viewing the VB Databases Basics 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 June 26th, 2004, 08:21 AM
Authorized User
 
Join Date: Jun 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default sql statement

hi i want to create a sql statement that gets all records from a table (admin) where the username = (what the user typed in, into the text box) and password = (what the user typed in, into the text box)

so far i have managed to come up with this, i dont know whether this is correct becuase when i debug i find my datareader object is empty

"Select * From admin Where password=? and username=?"
many thanks


 
Old June 26th, 2004, 09:24 AM
Authorized User
 
Join Date: Jun 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default


select * from admin where userid ='" & txtuser.text & "'" And password = '" & pass.text & "'"

hope it will help you...

Stay Beautiful,
Abdul Salam
 
Old September 29th, 2004, 09:48 AM
Authorized User
 
Join Date: Sep 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Lalit_Pratihari
Default

Hi,

Just a little addition:

Do remember to trim the value in the text boxes and add the single quotes if the datatype is of character type.

SELECT * FROM ADMIN WHERE USERID = '" & Trim(txtuser.text) & "'" AND PASSWORD = '" & Trim(pass.text) & "'"

Thanks,

Lalit
Life Means More...;)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with SQL Statement forumsUID SQL Server 2000 1 August 23rd, 2007 08:08 AM
convert a SQL Statement from MS Access to a SQL Corey Access 6 March 28th, 2007 12:33 PM
SQL Statement rylemer SQL Language 3 October 21st, 2005 09:07 PM
Sql Statement help morpheus Classic ASP Basics 0 March 9th, 2004 10:55 AM
sql statement [email protected] Beginning VB 6 2 June 23rd, 2003 04:28 PM





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