User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 456,521 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,802 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 1891 | Replies: 3
Reply
Join Date: Jul 2007
Posts: 102
Reputation: hawisme000 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
hawisme000's Avatar
hawisme000 hawisme000 is offline Offline
Junior Poster

HELP pls, making a Login form.

  #1  
Oct 2nd, 2007
hello every1, really i need help on how i can make a login form that works and is connected to my database using ADO

my frmlogin is composed of 2 textbox (txtuser,txtpass)
and 2 command buttons (cmdlogin,cmdcancel)
and my database name is (MAINDB2)
inside MAINDB2 is (tblReg)
fields inside tblReg is (Username,Password)

and for example , field Username contains (tester)
, field Password contains (testpass)

and when i put (tester) in the txtuser
and (testpass) in the txtpass

i will do this

MAINMENU.show
unload me

-------------------------PLS HELP ME!!! =( --------------------------------
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,444
Reputation: debasisdas is on a distinguished road 
Rep Power: 4
Solved Threads: 87
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Nearly a Posting Virtuoso

Re: HELP pls, making a Login form.

  #2  
Oct 2nd, 2007
Check for existance of username and the corresponding password in database using SQL. Try to use count() . If it is 1 then login else prompt to enter the correct username and the corresponding password.
Share your Knowledge.
Reply With Quote  
Join Date: Jun 2007
Posts: 78
Reputation: manoshailu is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 6
manoshailu's Avatar
manoshailu manoshailu is offline Offline
Junior Poster in Training

Help Re: HELP pls, making a Login form.

  #3  
Oct 5th, 2007
hi,

Follow the below instructions, if u hv any doubts u can ask me.
1) First set reference to use ADO Project Menu-> Reference-> Microsoft Activex Data Objects 2.6 Library
2) Create DSN Start-> Run->odbcad32->ADD

MS- Access
Select Microsoft Access Driver(*.mdb)-> Finish
type the name in Data Source Name
then select database by clicking select button
browse the database then press ok again press ok
DSN Created
Oracle
Select Microsoft ODBC for Oracle-> Finish
type the name in Data Source Name, username of oracle
and server name of oracle(i.e.host string)
then press ok
DSN Created

Sql Server
Select Sql Server-> Finish
type the name in Data Source Name
select the system name in server where your database is located
then press next select with Sql Server authentication
and unmark check box and give the username and password of your sql server
then press next select database press next finally click finish
DSN Created

3) Code
'write the code outside the procedure
Dim cn as new Adodb.connection
Dim rs as new Adodb.recordset
Private Sub Form_Load()
set cn = new adodb.connection
set rs = new adodb.recordset
'Accesscn.open "login",false
'Oraclecn.open "login","scott","tiger"
'Sql Server if password available give password
cn.open "login","sa",false
End Sub
Private Sub Command1_Click()
rs.open "select count(*) from login where username = '" & text1.text & "' and password = '" & text2.text & "'",cn,adopendynamic,adlockoptimistic
if rs(0)=0 then
msgbox "Unknown User"
else if rs(0)=1 then
MAINMENU.show
unload me
end if
End Sub

shailu

Originally Posted by hawisme000 View Post
hello every1, really i need help on how i can make a login form that works and is connected to my database using ADO

my frmlogin is composed of 2 textbox (txtuser,txtpass)
and 2 command buttons (cmdlogin,cmdcancel)
and my database name is (MAINDB2)
inside MAINDB2 is (tblReg)
fields inside tblReg is (Username,Password)

and for example , field Username contains (tester)
, field Password contains (testpass)

and when i put (tester) in the txtuser
and (testpass) in the txtpass

i will do this

MAINMENU.show
unload me

-------------------------PLS HELP ME!!! =( --------------------------------
Reply With Quote  
Join Date: Jul 2007
Posts: 102
Reputation: hawisme000 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
hawisme000's Avatar
hawisme000 hawisme000 is offline Offline
Junior Poster

Re: HELP pls, making a Login form.

  #4  
Oct 5th, 2007
thx for the help!! appriciate it so much
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 4:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC