943,824 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Jun 6th, 2007
0

accessing ms access from VB

Expand Post »
hi....i m actually developing a tool which uses access as the database source...i hv created 2 coloumns in the database....username and password....now in my tool i need to ask the user fr his username and password....if it matches with any of the combinations stored in the database then the user can login ....cn anyone help me wiith dis ....
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
anud18 is offline Offline
52 posts
since Jun 2007
Jun 6th, 2007
0

Re: accessing ms access from VB

You need to open the Access table, and then step through each record testing the value the user has entered with the value in each record. If user name is same then check password to be same.

How far have you got with writing VB to open tables and read contents ?
Reputation Points: 22
Solved Threads: 19
Posting Whiz
DenisOxon is offline Offline
345 posts
since Jan 2007
Jun 6th, 2007
0

Re: accessing ms access from VB

actually i know the steps to do it......but m nt being able to figure out how to connect to the database by using ADO......wen i try to open the database using the following code it opens up a SELECT DATA SOURCE DIALOGUE BOX.....plz help me wid this

Dim dbUserName As Database
Dim rsUserName As Recordset

Set dbUserName = OpenDatabase(db1)

dbi is the database name stored on the desktop....
the third line of code which is posting a problem...
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
anud18 is offline Offline
52 posts
since Jun 2007
Jun 7th, 2007
0

Re: accessing ms access from VB

Click to Expand / Collapse  Quote originally posted by anud18 ...
actually i know the steps to do it......but m nt being able to figure out how to connect to the database by using ADO......wen i try to open the database using the following code it opens up a SELECT DATA SOURCE DIALOGUE BOX.....plz help me wid this

Dim dbUserName As Database
Dim rsUserName As Recordset

Set dbUserName = OpenDatabase(db1)

dbi is the database name stored on the desktop....
the third line of code which is posting a problem...

For the momemnt where is db1 defined in your code ?


I have an application which does what you want. I will look it up tonight and post.
Reputation Points: 22
Solved Threads: 19
Posting Whiz
DenisOxon is offline Offline
345 posts
since Jan 2007
Jun 7th, 2007
0

Re: accessing ms access from VB

thanx.... i hv been able to develope the tool......now i further want to modify it...

i.e now i want to connect/open up the database which is password protected....how do i do that through VB
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
anud18 is offline Offline
52 posts
since Jun 2007
Jun 7th, 2007
0

Re: accessing ms access from VB

Click to Expand / Collapse  Quote originally posted by anud18 ...
thanx.... i hv been able to develope the tool......now i further want to modify it...

i.e now i want to connect/open up the database which is password protected....how do i do that through VB

Thanks for letting us know.

I struggled to get a password protected database to open, so I won't guess but I'll look it up to night and post.
Reputation Points: 22
Solved Threads: 19
Posting Whiz
DenisOxon is offline Offline
345 posts
since Jan 2007
Jun 7th, 2007
0

Re: accessing ms access from VB

i wud be grateful 2 u....plz post it 2day
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
anud18 is offline Offline
52 posts
since Jun 2007
Jul 25th, 2007
0

Re: accessing ms access from VB

hi,im a newbie in vb.im developing a small system for practical project.i've used adodc data control to connect from vb to the database.i want to send datas from the form ive created to my database.however,i kept facing the same error that says :
run-time error 91
Object variable or with block variable not set

here are my codings:
Private Sub Cmd_Submit_Click()

Adodc1.Recordset.AddNew

Adodc1.Recordset.Fields("Contact_No").Value = Txt_Contact.Text
Adodc1.Recordset.Fields("Reserv_No").Value = Txt_Reserv_No.Text
Adodc1.Recordset.Fields("Reserv_Date").Value = Txt_Date.Text
Adodc1.Recordset.Fields("Booking_Time").Value = Txt_Time.Text
Adodc1.Recordset.Fields("Type_Code") = Cmb_Type.ListIndex
Adodc1.Recordset.Fields("Payment") = Txt_Payment.Text
Adodc1.Recordset.Fields("Receipt_No") = Txt_Receipt.Text

Adodc1.Recordset.Update

MsgBox "Record has been saved", vbOKOnly + vbInformation

End Sub

can anyone please help me?im extremely new with this..thanx..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rumi is offline Offline
6 posts
since Jul 2007
Jul 26th, 2007
0

Re: accessing ms access from VB

Anud,

Please look in the thread Read Me. Access to any type of DB is possible
started by me.

Happy Programming
AV Manoharan
Reputation Points: 10
Solved Threads: 9
Junior Poster
AV Manoharan is offline Offline
166 posts
since Jun 2007
Jul 26th, 2007
0

Re: accessing ms access from VB

Quote ...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Cmd_Submit_Click()
  2.  
  3. Adodc1.Recordset.AddNew
  4.  
  5. Adodc1.Recordset.Fields("Contact_No").Value = Txt_Contact.Text
  6. Adodc1.Recordset.Fields("Reserv_No").Value = Txt_Reserv_No.Text
  7. Adodc1.Recordset.Fields("Reserv_Date").Value = Txt_Date.Text
  8. Adodc1.Recordset.Fields("Booking_Time").Value = Txt_Time.Text
  9. Adodc1.Recordset.Fields("Type_Code") = Cmb_Type.ListIndex
  10. Adodc1.Recordset.Fields("Payment") = Txt_Payment.Text
  11. Adodc1.Recordset.Fields("Receipt_No") = Txt_Receipt.Text
  12.  
  13. Adodc1.Recordset.Update
  14.  
  15. MsgBox "Record has been saved", vbOKOnly + vbInformation
  16.  
  17. End Sub
yoiu'll probably get an error if you do not set the datasource of that adodc!
Last edited by jireh; Jul 26th, 2007 at 9:11 pm.
Reputation Points: 11
Solved Threads: 49
Posting Whiz
jireh is offline Offline
316 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Trying to create a Simple AIO need help!
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: vb6 help needed for bill printing





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC