•
•
•
•
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,519 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,806 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: 1392 | Replies: 5 | Solved
![]() |
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
it will connect
and do this
MAINMENU.show
unload me
-------------------------PLS HELP ME!!! =( --------------------------------
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
it will connect
and do this
MAINMENU.show
unload me
-------------------------PLS HELP ME!!! =( --------------------------------
•
•
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,444
Reputation:
Rep Power: 4
Solved Threads: 87
sir choudhuryshouvi THANK YOU SOO MUCH!!!
really learn alot form the file u gave,
especially about the VISUAL-DATA MANAGER thing,
again t,y
umm, just wanna ask something if you wont mind,,
how can i connect to a access 2003 without using VDM??
just curious... and wants to learn more ,
sorry if im beginning to be a pain sir
really learn alot form the file u gave,
especially about the VISUAL-DATA MANAGER thing,
again t,y
umm, just wanna ask something if you wont mind,,
how can i connect to a access 2003 without using VDM??
just curious... and wants to learn more ,
sorry if im beginning to be a pain sir
no question of pain. i feel always happy when i do reply to someone. ok, lets begin.
to connect the database without using the VDM you need to create an ODBC DSN for the type of database you wish to connected to.
to create the DSN follow the step:-
1.goto control panel
2.select administrative tools
3.select datasources(odbc)
4.in the user dsn tab click on add
5.select the appropriate database driver.
for access it is "Microsoft Access Driver(.mdb)"
for sql server it is "Sql Server"
for oracle it is "Oracle in orahome<version no>"
where version no. is the version of oracle u have installed in ur server machine.lets say if u have oracle9i installed then the driver becomes "oracle in orahome9i",etc.
6.after selecting the driver click finish.
7.then in the dsn dialog box enter the dsn name in the provided textbox.this name can be anything.but make sure that it doesn't conflict with other dsn names.
8.you can also specify a description fror ur dsn there.this is an optional field.
9.then click the select button and locate the database file you wish to connect through the new dsn being created.click ok to save all settings and create the dsn.
in case of operation with vb6 do the following steps:-
1.open a new project
2.goto project->reference
3.check on microsoft activex dataobjects <version no> library.again this version no. depends on the version of ur os and the version of ms-office u have installed.
4.click ok to add the reference to ur project.
*******now try this sample coding syntax***
'in form_load event......this is for connecting the database through the dsn
dim conn as new adodb.connection
dim rs as new adodb.recordset
dim str as string
on error goto err1
str="DSN=<your dsn name>;UID=<YOUR DB USERID,if any>;PWD=<YOUR DB PASSWORD,if any>;DBQ=<APPLICABLE FOR ORACLE DRIVERS ONLY>"
conn.connectionstring=str
conn.open
msgbox "The database has been connected and ready for use."
exit sub
err1:
err.clear
msgbox "Connection failed.Please check ur DSN configuration."
exit sub
after this you will be in the condition to begin any transaction with the access,sql server and oracle databases.
to connect the database without using the VDM you need to create an ODBC DSN for the type of database you wish to connected to.
to create the DSN follow the step:-
1.goto control panel
2.select administrative tools
3.select datasources(odbc)
4.in the user dsn tab click on add
5.select the appropriate database driver.
for access it is "Microsoft Access Driver(.mdb)"
for sql server it is "Sql Server"
for oracle it is "Oracle in orahome<version no>"
where version no. is the version of oracle u have installed in ur server machine.lets say if u have oracle9i installed then the driver becomes "oracle in orahome9i",etc.
6.after selecting the driver click finish.
7.then in the dsn dialog box enter the dsn name in the provided textbox.this name can be anything.but make sure that it doesn't conflict with other dsn names.
8.you can also specify a description fror ur dsn there.this is an optional field.
9.then click the select button and locate the database file you wish to connect through the new dsn being created.click ok to save all settings and create the dsn.
in case of operation with vb6 do the following steps:-
1.open a new project
2.goto project->reference
3.check on microsoft activex dataobjects <version no> library.again this version no. depends on the version of ur os and the version of ms-office u have installed.
4.click ok to add the reference to ur project.
*******now try this sample coding syntax***
'in form_load event......this is for connecting the database through the dsn
dim conn as new adodb.connection
dim rs as new adodb.recordset
dim str as string
on error goto err1
str="DSN=<your dsn name>;UID=<YOUR DB USERID,if any>;PWD=<YOUR DB PASSWORD,if any>;DBQ=<APPLICABLE FOR ORACLE DRIVERS ONLY>"
conn.connectionstring=str
conn.open
msgbox "The database has been connected and ready for use."
exit sub
err1:
err.clear
msgbox "Connection failed.Please check ur DSN configuration."
exit sub
after this you will be in the condition to begin any transaction with the access,sql server and oracle databases.
Last edited by choudhuryshouvi : Oct 4th, 2007 at 5:32 am.
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- login form (PHP)
- Login form in VB.net (VB.NET)
- Need help to create a login form (VB.NET)
- Help with making a survey form (HTML and CSS)
- Making a Fullscreen form and hiding the Windows Taskbar (Pascal and Delphi)
- login scripts (PHP)
- php login form (PHP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: File name for linked tables
- Next Thread: controlling an app in foreground from one running in background



Linear Mode