| | |
accessing ms access from VB
![]() |
•
•
Join Date: Jun 2007
Posts: 52
Reputation:
Solved Threads: 0
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 ....
•
•
Join Date: Jun 2007
Posts: 52
Reputation:
Solved Threads: 0
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...
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...
•
•
•
•
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.
•
•
•
•
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.
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..
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..
•
•
•
•
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
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
Last edited by jireh; Jul 26th, 2007 at 9:11 pm.
A conclusion is the place where you got tired of thinking. http://www.martin2k.co.uk/forums/index.php?showforum=4
http://www.a1vbcode.com/a1vbcode/vbforums/Forum3-1.aspx
http://www.developerfusion.co.uk/for...orum&ForumID=4
![]() |
Similar Threads
- Private Access (C++)
- Accessing an Access Database using Java (Java)
- Begin transaction in VB? (Visual Basic 4 / 5 / 6)
- problems with recordset accessing access (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Trying to create a Simple AIO need help!
- Next Thread: vb6 help needed for bill printing
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





