accessing ms access from VB

Reply

Join Date: Jun 2007
Posts: 52
Reputation: anud18 is an unknown quantity at this point 
Solved Threads: 0
anud18 anud18 is offline Offline
Junior Poster in Training

accessing ms access from VB

 
0
  #1
Jun 6th, 2007
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 ....
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 319
Reputation: DenisOxon is an unknown quantity at this point 
Solved Threads: 15
DenisOxon's Avatar
DenisOxon DenisOxon is offline Offline
Posting Whiz

Re: accessing ms access from VB

 
0
  #2
Jun 6th, 2007
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 ?
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 52
Reputation: anud18 is an unknown quantity at this point 
Solved Threads: 0
anud18 anud18 is offline Offline
Junior Poster in Training

Re: accessing ms access from VB

 
0
  #3
Jun 6th, 2007
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...
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 319
Reputation: DenisOxon is an unknown quantity at this point 
Solved Threads: 15
DenisOxon's Avatar
DenisOxon DenisOxon is offline Offline
Posting Whiz

Re: accessing ms access from VB

 
0
  #4
Jun 7th, 2007
Originally Posted by anud18 View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 52
Reputation: anud18 is an unknown quantity at this point 
Solved Threads: 0
anud18 anud18 is offline Offline
Junior Poster in Training

Re: accessing ms access from VB

 
0
  #5
Jun 7th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 319
Reputation: DenisOxon is an unknown quantity at this point 
Solved Threads: 15
DenisOxon's Avatar
DenisOxon DenisOxon is offline Offline
Posting Whiz

Re: accessing ms access from VB

 
0
  #6
Jun 7th, 2007
Originally Posted by anud18 View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 52
Reputation: anud18 is an unknown quantity at this point 
Solved Threads: 0
anud18 anud18 is offline Offline
Junior Poster in Training

Re: accessing ms access from VB

 
0
  #7
Jun 7th, 2007
i wud be grateful 2 u....plz post it 2day
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 6
Reputation: rumi is an unknown quantity at this point 
Solved Threads: 0
rumi's Avatar
rumi rumi is offline Offline
Newbie Poster

Re: accessing ms access from VB

 
0
  #8
Jul 25th, 2007
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..
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 166
Reputation: AV Manoharan is an unknown quantity at this point 
Solved Threads: 9
AV Manoharan AV Manoharan is offline Offline
Junior Poster

Re: accessing ms access from VB

 
0
  #9
Jul 26th, 2007
Anud,

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

Happy Programming
AV Manoharan
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 300
Reputation: jireh is an unknown quantity at this point 
Solved Threads: 42
jireh's Avatar
jireh jireh is offline Offline
Posting Whiz

Re: accessing ms access from VB

 
0
  #10
Jul 26th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC