Database Guide

Level:
Level2

This Visual Basic 6 guide walks you step by step through VB6 tutorials and VB6 source code on this site that will help you learn how to develop applications that store and retrieve data from database back ends. As you read each of these database tutorials you will gain more and more knowledge in how to handle databases in your VB apps. The best way to navigate through the guide is by using the links on the left. Or you can use the links below and then hit your browser's back button. Each link will take you to a different vb6 database tutorial on this site that will teach you the next step you need in order to become a VB6 database guru.

  1. To do anything of value in Visual Basic related to databases you will first need to learn how to write SQL statements to extract what you want from your back end database. This applies to not only Microsoft SQL server but also to Access and Oracle databases. Learn how with this Introduction to SQL (Structured Query Language)
  2. The data control in VB6 allows you to interact with your backend database with out having to write all the code by hand. This is great when you are first learning how to do database development in Visual Basic or for quick and simple VB6 database applications. For more complicated applications you will probably use ADO. Still check out this Database Access with the VB6 Data Control tutorial to start getting your feet wet.
  3. This tutorial is optional as DAO is a somewhat older way of Visual Basic database development. However, if you ever have to interact with older code its good to at least understand the basics of this. Check out the Using DAO (Data Access Objects) Code Tutorial
  4. Again, RDO is still not the newest (and best) way to access back end data. However, there is a lot of VB database code out there that uses RDO so its probably good to at least glance through this tutorial in order to know what to do if you ever work on and VB RDO project. Database Access with RDO (Remote Data Objects) in VB6
  5. This is a must read! Visual Basic ADO development is the newest (and best) way to interact with any database. After walking through this tutorial you should be able to have every tool in your belt to grab data, modify it, and write back to any database you come in contact with. Any VB6 database developer must read this Database Access With ADO in VB6 tutorial
  6. Once you understand all the basics of how to use ADO to work with a database you will probably want to display that data to your end user in some way. One very effective way of doing this is with the list view that is built into the VB6 IDE. Using ADO and the ListView control in VB6
  7. It is bad programming practices to write all your SQL statments directly into your Visual Basic source code. This makes it hard to change things down the road and also has a performance disadvantage compared to using stored procedures. Learn how all this works in this tutorial: Using ADO and stored procedures in VB6
  8. If you ever need to print of reports for end users you might want to consider using Crystal Reports. Although many times you can get away with writing your own reports or exporting things to Excel or Word at times this isn't an option. Check out this Using Crystal Reports with VB6 tutorial to learn more about how to create these for your end users.
  9. Optional: This is optional because unless you are having to interact with an Oracle database you will never need to know this information. However if there is a time you need to use Visual Basic and Oracle together I recommend you check out this
  10. If you enjoyed this post, subscribe for updates (it's free)

Connecting MS Access with Visual Basic 6.0 and making .exe file.

To connect MS Access with Visual Basic 6.0 :-
1. Create a file in MS Access (i.e. Project.mdb)
2. Create a table in this file,
3.Save,
4.Now close the MS Access.
5.Now go to control panel
6.Click on System and Security
7.Click on Administrative Tools
8.Double click on Data Source (ODBC) Administrator
The ODBC Data Source Administrator window will be appeared.In this window
9. Click on user DNS tab
The Create New Data Source window will be appeared. In this window,
10. Select Microsoft Access Driver (*.mdb)
11. Click on finish.
ODBC Microsoft Access Setup window will be appeared. In this window
12. Enter the name of Data Source Name in the Data Source Name box ( i.e. Project)
13. Click on Select button under Database.
14. Select the created MS Access file (i.e. Project.mdb)
15. Click Ok
16. Click Ok in ODBC Microsoft Access Setup window
17. Click OK in ODBC Data Source Administrator window.
18. Now open MS Visual Basic 6.0
19. Create a project
20. Now Go to Project menu
21. Click on components
22. In Controls tab tick ( click ) the Microsoft ADO Data Control 6.0 (OLEDB)
23. Click Ok.
24. Now draw the ADODC in the form.
25. Right click on the ADODC in the form
26. Click on ADODC Properties
27. In general tab click on Use ODBC Data Source Name
28. Select the Project (The Project is User DNS which is created by us in ODBC Data Source Administrator)
29. Now click on Record Source tab
30. Select adCmdTable in Command Type
31. Select the name of table ( i.e. enrollment) in Table or Stored Procedure Name
32. Click Ok
33. Now draw a textbox then attach the textbox with the datacontrol in the textbox properties.
To make .exe file:-
1. Go to file menu
2. Click make Project1.exe

need help

hey im lost on stem number 28, can you please elaborate what you mean when you say 'select the project"

Stem 28

In stem 28, the Project is a Data Source Name (DNS) which is created in ODBC Data Source Administrator window by clicking Add.... command button in User DNS tab and selecting Microsoft Access Driver (*.mdb) in Create New Data Source window and typing the "Project" in Data Source Name box in ODBC Text Setup window.
The Data Source Name (DNS) "Project" can be selected in ADODC Properties, by clicking Use ODBC Data Source Name option in General tab and then click on triangle symbol of combo box which is in the Use ODBC Data Source Name (DNS) option, then the list of Data Source Name (DNS) will be appeared, and then select the Data Source Name (DNS) "Project" from it.

Here enrollment is the name

Here enrollment is the name of table created in Project.mdb (ms access).

vb6

hi sir can you make a program for me.. about enrollment system using adodc.. and coonect to database

Ganyan din ang program na

Ganyan din ang program na ide-defense namin sa finaltem! enrollment system uding ADODC and ico-conect sa database. my SQL pa nga un.

Help...

If you need any help, add me at MSN or send me your questions here:
chrzgt7@hotmail.com

Waiting for your reply. See you!

send me some commands........

send me some commands........

Syntax for the SQL "LIKE"

hello,

I need some help in making a search code. Have trouble of getting the right codes for a search code. Have a code but it seems that it doesnt searches with the category "LIKE". it searches only if it find exactly the expression that I input in a text box. Which is not what I want. (Below is what is the code that I wrote)

ado1.RecordSource = "Select * from tblQuote where QrefNo Like '" & Text1.text & "'"

HELP plss!!! :)

Done!

Here is an example of code you are looking for:

Private Sub Text1_Change()
Adodc1.RecordSource = "SELECT * FROM tblQuote WHERE QrefNo LIKE '%" & Replace$(Text1.Text, "'", "''") & "%'"
Adodc1.Refresh
End Sub

The Replace function will help in avoiding a run-time error when the user types the character < ' >.

If you need any more help, send me at: chrzgt7@hotmail.com.

thanks dude your code works

thanks dude your code works for me..appreciate it

Hi, I have more log in User

Hi,
I have more log in User to my Database(Access2007)
and I want code can show User Name on report access.
Ex: 1- Mr Apple Log In on report show User Name Mr Apple.
2- Mrs Orage Log In on report show User Name Mrs Orage.
Please help.

E-mail...

Send me a message at chrzgt7@hotmail.com.

ChrisGT7

want codings

Sir. I need help.
How do I make a search engine using VB 6.0 and the database is MS Access.
For example:
I have the name, and when I click the command button (SEARCH)
the records of the name I type will be the only who will appear the same record wat we search in first time??

Please Sir.

do yall know hw to convert a

do yall know hw to convert a IFF data file into database access which is in mdb file format??

Patient Information Management & Billing System

Hi, please help me with a code to Register a patient in VB6

Thanks

ewen ko ba

oh... what is it ...
magic,,,:)

Asking about vb6 using data form wizard

please I want u to send a code that I can use to search a customer using customer code number. I'm writing a project called computerazation of accounting records.
thanks for Ur help.

i need form design

i need form design about pay roll management and their particulars

Open Access data base from Shared PC by second PC

Hi.

My Main Data base File in Access 2003.File Extention is Filename.mdb(.mdb). My Shared pc ip is like 111.112.22.174. I want to access this file from my Second PC. its IP is like 111.112.22.184. My Data base file is in first PC in path is like "\\111.10.11.11\Reports\Filename.mdb"
I want to open that file from my VB6 Project.exe. By this exe i am entering data and run query in that ms access file. I can run all process by my first pc(111.112.22.174) but now I want to run same exe from my second PC(111.10.11.11). Exe is run properly but it can not run query or Process any thing in Data because database file is in First computer. So I want to access that file from my second PC so I can run query and other Process from any PC which is in My Network Lan.

Thanks
Jayesh

Kindly Assist Me...

Pls sir, i need your help in getting a "school Management code in vb".
i will be greatful if you can help me out.
i will be expecting to hear from you in my mail box.
thanks.

wrong code u telling us

Your coding is not useful for us. so don't misguide us..and if you are exactly help to students.. so pls. provide the full information regarding login form and accessing the database ...

about vb

Hello, what code you use the command using a data grid when it done it will find the data and have similar ... please help me

Need a help to convert text2mdb

Dear sir,

i have a text file like

name~ID~Address~phone~email
anik~0001~khilgao,Dhaka~51542151~abd@yahoo.com
Abid~0002~Polton,Dhaka~5545451~dfa@yahoo.com

i have also a table in blank access table in same format and field

Name,ID,Address,Phone,Email

Please help me by vb6.0 code for convert a text file (*.txt)to Access database (*.mdb)

Thanks/Br
Tareq

Sir

Sir. I need help.
How do I make a search engine using VB 6.0 and the database is MS Access.
For example:
I have the name, and when I click the command button (SEARCH)
the records of the name I type will be the only who will appear to the datagrid??

Please Sir. Heelp po
I am working as an OJT, and I have to do a program..
And thats the only thing, thats why I cant pass it yet.

Your solution

Reply me to this address by your own email i will send you the solution.

Re: Search Engine

It is very possible to make a search engine using vb 6.0 Access and DAO please email me and Wewill discuss the project. You can also give me a skype francisndungu or G-talk: francisndungu83@gmail.com

Vb & MS Access Coneectivity

Sir,
I have attached one VB File & MS Access Database file these to Files are to be connected.
I have only made the Forms and database
1. I want to enter data through VB and that data is stored in MS access. and also fetch data and show or print data
2. 1st form is Customer details and 2nd form is Customers Order details, and other is product detail form which we use to provide to the customers,
3. Search , Print, Save, EDIT. options should be there.
-------------
Sir, Please Do this for me.I will be very obiliged to you. at least one form with customer details should be get connect to the database. can u please send me by today or tomorrow.

That's easy friend

Just send an e-mail if you get this or if you would see this, and I will make it happen... Do this through the given e-mail above.

vb

sir,
i want to connect data base to vb6 combo box, and get all data in name field to combo box list,how do i?

I mean this e-mail:

I mean this e-mail: zoelike2003@yahoo.co.uk and it will be made easy!

Visual Basic 6 Question

I am pleasure to visit this site it is a wonderful ,
i will show my question below with clear way and hope to someone to response to me

My issue:
just i use vb6 and use DAO to connect to database at the time i try to use the program in workgroup computers (shared database) someone said to me that the ado library is better fore network but i do not want how to make Edit by ADO , just i make the program and in database path i wrote for ex //pc4/shared folder/work.mdb and make 3 exe file for pc1 and pc2 and pc3 and it worked successful to add,edit, find and delete is that right?

my ques:
1. how can i edit by ADO?
2.i have to use winstock object when i use shared database or not ?

Please Sauggetion

I am a new in Vb project line.
But I trainny to you but this time i have fail because i do not find my problem's solution.
My Problem is Excel Database, how to connect Excel sheet database.
Thanking You
Mantu Swain

Find the data from text1.text and in same data come to other

Kindly send the code using datacontroller to find and get the data without using command tools if i give text1.text = 3, means in text2.text = i want get the partyname of equal to = 3 , Kindly help me anybody thanks,
regards
sathish

Fetch PDF data and store it in to DataBase

Kindly tell me how can i directly (without using any utility like PDF to TEXT) fetch data of pdf file and store it into data base.

Password change form code

Please provide me with the necessary form code...It should be simple...Front end is vb6 and back end is ms access...I need no encryption algorithms...Please mail me the form code..It's urgent

Here is my login code

Option Explicit
Public conn As New ADODB.connection
Public rs As New ADODB.Recordset

Sub connection()
Set conn = New ADODB.connection
conn.CursorLocation = adUseClient
conn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\data\dbRupali.mdb"
End Sub

Private Sub cmdcancel_Click()
End
End Sub

Private Sub cmdOK_Click()
Set rs = New ADODB.Recordset
With rs
.Open "Select * from login WHERE username = '" & txtUserName.Text & "' and pass = '" & txtPassword.Text & "' ", conn, adOpenStatic, adLockOptimistic
If .EOF Then
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
MsgBox "Invalid authentication!", vbExclamation, "User Authentication"
Else
'Unload Me
'show form here for admin
MsgBox "Successfully Loged in Restaurant And Bar Management system ", vbInformation, "User Authentication"
frmLogin.Hide
frmMain.Show
frmWelcome.Show
End If
End With
End Sub

Private Sub Form_Load()
Call connection
End Sub

login page on access

i typed this code in for a log in form on access and when i click the command 6 button, nothing is happening. any ideas?

Private Sub Command6_Click()

If Username.Text = "user1" And Password.Text = "user1" Then
MsgBox "Access Granted", vbInformation, "Buxton Hotel"
MsgBox "Welcome", vbInformation, "Buxton Hotel"
DoCmd.Close
DoCmd.OpenForm = "FRMMAINMENU"
Else
MsgBox "Please Re-Enter your Username and Password"

End If
End Sub

Option Explicit Public

Option Explicit

Public LoginSucceeded As Boolean

Private Sub cmdCancel_Click()
'set the global var to false
'to denote a failed login
LoginSucceeded = False
Me.Hide
End
End Sub

Private Sub cmdOK_Click()
'check for correct password
If txtPassword = "password" And UCase(txtUserName) = UCase("Auto") Then
'place code to here to pass the
'success to the calling sub
'setting a global var is the easiest
LoginSucceeded = True
Me.Hide
MDIForm1.Show
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub

try this

Option Explicit

Public LoginSucceeded As Boolean

Private Sub cmdCancel_Click()
'set the global var to false
'to denote a failed login
LoginSucceeded = False
Me.Hide
End
End Sub

Private Sub cmdOK_Click()
'check for correct password
If txtPassword = "password" And UCase(txtUserName) = UCase("Auto") Then
'place code to here to pass the
'success to the calling sub
'setting a global var is the easiest
LoginSucceeded = True
Me.Hide
MDIForm1.Show
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub

Could be Error

I would set a break point at the top of the subrutine (F9) on "If UserName.text..."
Then "Step" through each line with "F8" hovering over an variables or controls to see what the value has been set to.

My guess is there is a control name that is not right, and since there is no err statements: ie On Error Goto... or On Error Resume Next, when an error does occure, the pointer is immediatelly exiting this subroutine.

You could: Set the breakpoint as discribed above. When you hit the command button (6) the program will hault.
Next Right Click on the code page and you should see a popup memu with "Toggle" in it. Select "Toggle" and select "Break on all errors". Next press F5 to continue the program.

Whatever is causing the error will cause a messgebox to appear with the an "End" or "Debug" buttons.
Press Debug to see which line caused the error.

ADODC and access 2007

Hi
I am making mutiple choise test
1. My database is access 2007, and 1 of data type is OLE object, because I want to save image. I use ADODC to conect access but I can not connect with file have OLEoject
2.How to take ramdom question from question I saved in ACcess.

Thank for helping
trang vo

Why OLE object?

I don't understand "but I can not connect with file have OLEoject"

If you are using Adodc1 database control, you should be able to connect to the database using an ODBC DSN.
Let me know if you are able to this.
If so...
With a connection made, you can send the SQL with

Dim iIndex as Integer
Adodc1.Resource = "SELECT * FROM <table> WHRE <field> = '..... ';
Adodc1.Refresh
If Adodc1.Recordset.RecordCount >  then 
     iIndex = Int(Rnd(1) * Adodc1.Recordset.RecordCount) + 1 
     Adodc1.Recordset.AbsolutePosition = iIndex
    Question$ = Adodc1.Recordset!<field>      
end if

Hey

I Need help
I'm Using Data Control usibg Visual Basic 6.0 and I need a code that Searchs records from my Access Databsr and displys on my Vib Form

coding a search button

Private Sub cmdsearch_Click()
Dim searching As String
searching = InputBox("enter name to find")
searching = Trim$(searching) 'remove surplus spaces
If searching = "" Then 'cancel if nothing entered
MsgBox "enter search value", vbOKCancel
Exit Sub
Else
With Adodc1.Recordset
.MoveFirst
.Find "Fname like '" + searching + "*'" ' Fname is thw item you are searching
End With
End If
With Adodc1.Recordset
If .EOF Or .BOF Then 'record not found
MsgBox ("hey! there is no such record in this database")
.MoveLast
End If
End With

End Sub

how to store data in MS Access

Hey,
I want to store data in MS access by using VB
how can I do it?
I'm waiting your answers

Store Data

Generly after you send your SQL to get to the Record in the database, you simple set each field with
Adodc1.Recordset!= 'replace and with the actual field-name and value.

when all fields are set use:
Adodc1.Recordset.UpdateBatch

(change Adodc1 with your ADO control name.)

Hello

Hello Sir,

I WANT TO MAKE A REQUEST HERE...

I WANT A CODE...ACTUALLY I WANT TO SAVE NAME OF STUDENT THT WE ENTER IN TEXT FIELD IN VB FORM TO GET SAVED IN ACCESS DATABASE. PLEASE ALSO HELP ME HOW TO CONNECT VB 6.0 FORM WITH ACCESS.

THANKS
REGARDS
CHANDAN AGARWAL

PLEASE SEND SAME ON PRIORITY BASIS...

regarding connection

if you want to connect vb6.0 with access you can connect with help of Adodc.open vb6.o,then open Adodc control in that build connection string with Access(.mdb file) and test connection ,if test connection succed,it means that your connection is build.

USE YOUR OWN BRAIN. DO YOUR

USE YOUR OWN BRAIN. DO YOUR OWN WORK.

REGARDS

ANONYMOUS :)

huh.... and you NEVER asked

huh.... and you NEVER asked anyone for help? You nozzle

recipe management system

hi
i want to design a project computerizing all recipes in a system. in such that when u select recipe type then the form appears with all ingredients, equipment used and the standard procedures used. please can u help with the vb codes of this system. u send it thro' my email johndevis2572@yahoo.com. i like this website guys.

I would not mind helping with

I would not mind helping with this, but there would be a lot of needed information to continue.
What is the Access database version?
Do you know how to create an ODBC DSN?
Do you know how to link textboxes to the ADO control?

Normaly this type of information is chargeable.
Would you be willing to compensat a programmer for writing the applcation?

please help me on my project.

my project is exam generator using vb 6.0 my problem is what code is for calling the data in a database.
in textbox, when you type 10 items question and when you entered it, the 10 question will appear and its on datareport. thanks. thats all. i hope you will reply. :)

try using this with your

try using this with your recordsets

rs.Open "Select * FROM table where field <=" & textbox & " Order by q_id;", cn, adOpenDynamic, adLockOptimistic

field should be numeric

set datareport.datasource = rs

Help

Show data from Fire-bird (.fdb) Database using VB 6

help

I got a question about VB i am new to it.I am trying to make changes to existingform design, however whatever changes I make on VB form (delete button or anything) and then debugg it, it wont show me the required results. The VB is is connected with Database. Can you please help me what i am missing or is there any trigger which preventing me to make any chnages

I need to link my sql(ms

I need to link my sql(ms Access 2007) database tables with a VB 2010 interface n i dont know how to go about, please assist.

Guidance Information System

How i can acess my vb6.0 to my database?
i use module
Option Explicit
--------
module
-------
Public ADOConn As New ADODB.Connection
Public ADORst As New ADODB.Recordset
Public mstrSQL As String
Public rights As String

Public Sub Connect()
Set ADOConn = New ADODB.Connection
ADOConn.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & App.Path & "\GUIDANCEINFORMATION.mdb"
ADOConn.Open
End Sub

Public Sub Disconnect()
ADOConn.Close
Set ADOConn = Nothing
End Sub

---------
Form1
---------

Option Explicit
Private mdblMinAsking As Double
Private mstrUpdateType As String
Private mavntUSStates As Variant

Private Sub cmdAdd_Click()
txtFirstName.Text = ""
txtMiddleName.Text = ""
txtLastName.Text = ""
txtAddress.Text = ""
txtStudentNo.Text = ""
txtGender.Text = ""
txtCourse.Text = ""
txtBirthDay.Text = ""
txtContactNo.Text = ""

mstrUpdateType = "A"
txtStudentNo.SetFocus

End Sub

Private Sub cmdDelete_Click()
Module1.Connect
If MsgBox("Are you sure you want to delete this record?", _
vbYesNo + vbQuestion, _
"Delete") = vbNo Then
Exit Sub
End If
ADORst.Delete
ADORst.Requery
ADORst.Find "StudentNo > " & txtStudentNo.Text

If ADORst.EOF Then ADORst.MoveLast

Call PopulateFormFields
End Sub

Public Sub PopulateFormFields()
Module1.Connect
txtFirstName.Text = ADORst.Fields("firstname")
txtLastName.Text = ADORst.Fields("lastname")
txtMiddleName.Text = ADORst.Fields("middlename")
txtStudentNo.Text = ADORst.Fields("studentno")
txtGender.Text = ADORst.Fields("gender")
txtAddress.Text = ADORst.Fields("address")
txtContactNo.Text = ADORst.Fields("contactno")
txtBirthDay.Text = ADORst.Fields("dateofbirth")
txtDeptNo.Text = ADORst.Fields("departmentnumber")
txtIDNo.Text = ADORst.Fields("idno")

Call SetRecNum

End Sub

Public Sub GetPropertyData()
Module1.Connect
Dim blnGotData As Boolean

Do
mstrSQL = "select studentno" _
& " ,firstname" _
& " ,middlename" _
& " ,lastname" _
& " ,contactno" _
& " ,dateofbirth" _
& " ,bourse" _
& " ,idno" _
& " ,gender" _
& " from StudentProfile" _
& " where studentno >=" & mdblMinAsking & " order by Studentno"

Set ADORst = New ADODB.Recordset
ADORst.CursorLocation = adUseClient
ADORst.Open mstrSQL, ADOConn, adOpenDynamic, adLockOptimistic, adCmdText
Loop Until blnGotData
Call PopulateFormFields

End Sub

Private Sub cmdExit_Click()
If MsgBox("Do you really want to exit?", _
vbYesNo + vbQuestion, _
"Delete") = vbNo Then
Exit Sub

Else
End
End If
End Sub

Private Sub cmdSave_Click()

If mstrUpdateType = "A" Then
ADORst.AddNew
End If
ADORst.Fields("studentno") = txtStudentNo.Text
ADORst.Fields("firstName") = txtFirstName.Text
ADORst.Fields("middlemame") = txtMiddleName.Text
ADORst.Fields("lastname") = txtLastName.Text
ADORst.Fields("gender") = txtGender.Text
ADORst.Fields("address") = txtAddress.Text
ADORst.Fields("contactno") = txtContactNo.Text
ADORst.Fields("dateofbirth") = txtBirthDay.Text
ADORst.Fields("departmentnumber") = txtDeptNo.Text
ADORst.Fields("course") = txtCourse.Text
ADORst.Fields("idno") = txtIDNo.Text
ADORst.Update

If mstrUpdateType = "A" Then

ADORst.Requery
ADORst.Find "studentno = " & txtStudentNo.Text
'display status info about the new record
SetRecNum

End If

End Sub

Private Sub Form_Load()
Module1.Connect
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2

End Sub

Private Sub mnuSeminarDetails_Click()
Form2.Show
End Sub

Public Sub SetRecNum()
StatusBar1.SimpleText = "row" & ADORst.AbsolutePosition & "of" & ADORst.RecordCount
End Sub

-----------
Log iN
---------
Option Explicit

Dim RSLogin As New ADODB.Recordset

Private Sub cmdCancel_Click()
Set RSLogin = Nothing
Module1.Disconnect
End
End Sub

Private Sub cmdOK_Click()
Module1.Connect
If RSLogin.State = adStateOpen Then
RSLogin.Close

End If
RSLogin.Open "Select * from USERS_TABLE where Username = '" & txtUserName.Text & " '", ADOConn
If RSLogin.EOF = False Then
If txtPassword = RSLogin("Password") And txtPassword <> "" Then

MsgBox "Welcome" & RSLogin("Username") & ",you are logged in as" & RSLogin("Group"), vbOKOnly, "System"
rights = RSLogin("Group")
If LCase(rights) = "admin" Then
Form1.Show
Else
Form2.Show
End If
Unload Me
Else
MsgBox "Wrong Password", vbCritical + vbOKOnly, "System Error"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
Else
MsgBox "Username does not exist", vbCritical + vbOKOnly, "Login"
txtUserName.SetFocus
SendKeys "{Home}+{End}"
End If

End Sub

Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
End Sub

lame ~_~

showing your entire code in a forum? thats lame...

stupid

your just jealous because you do not have a code of your own.

a sign of stupidity!

object variable or with block at recordset.

hi all. i am completely new to vb. i am getting error when i use above code at "ADORst.Fields("studentno") = txtStudentNo.Text
" and the error is "object variable or with block" why i dont know .please help me.

Elow sir..

sir help me how create a user log in in vb6.0 connected with ms access...what are the code for creating a login..!!!

Displaying report on according to the Date we select

Sir I'm preparing a Library management kit by using the VB6.. I need to display the data-report on the date which i can select manually,, The data should be retrieved from the Table ISSUE & RETURN. So pls help me how to display the items from the about tables to a data-report sheet on the Date select condition. I use the data control box n datagrids

code in visual basic

if ill input the grade of 85% then the grade in letter is B

my solution

u can use if statement on doing that.

for example:

if txtpercentage.text >=80 and txtpercentage.text<=90 then
txtanswer.text="B"
end if
and so on...

just like that...

Airline Reservation System

Airline Reservation System VB6

Use a one-dimensional array to represent the seating part of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of the array to 1 to indicate that the seat is no longer available.
Your program should, of course, never assign a seat that has already been assigned, when the smoking section is full, your program should ask the person if it is acceptable to placed in the non-smoking section (and vice versa). If yes, then make the appropriate seat assignment. If no, then print the message “Next flight leaves in 3 hours.”

If the person types 1, then your program should assign a seat in the smoking section (seats 1-5). If the person types 2, then your program should assign a seat in the non-smoking section (seats 6 – 10). Your program should then show the person’s seat number and whether it is in the smoking or non-smoking section of the plane.

please help. mail me @ illdie4_you@yahoo.com

Done!

I have sent you the program to your mail.

For any further information, please tell me!

In Need

Please, i need that program too. That's what am working at on my project and also how to query an microsoft access database using visual basic 6.0. My mail is esorison@yahoo.com

Please send me too

Can you also send me the code for the Airline Reservation System VB6 at rohan_bhattarai@yahoo.com.

Airline Reservation System VB6

Can you also sendme the code for the Airline Reservation System VB6. I saw that you sent it to a few idividuals already. Thanks. ram2389@yahoo.com.