| | |
Problem with retrieving data from access 2003
Thread Solved |
Hi
I have a problem retrieving the data from access database. I have a list of records for eg. Name,user_name, password etc.(all in access)
The problem is ,i want a solution wherein , when i double-click on a name, i want all the details for that particular name.
* i am using acess database as backend and Visual Basic 2005 as Front-end
example:
list of names are:
member1
member2
.
.
.
member n
Now, when i double click on member1, all the details for member1 shud be displayed.
Any help will be higly appreciated.
I have a problem retrieving the data from access database. I have a list of records for eg. Name,user_name, password etc.(all in access)
The problem is ,i want a solution wherein , when i double-click on a name, i want all the details for that particular name.
* i am using acess database as backend and Visual Basic 2005 as Front-end
example:
list of names are:
member1
member2
.
.
.
member n
Now, when i double click on member1, all the details for member1 shud be displayed.
Any help will be higly appreciated.
You did not stated here how you access your database, Are you using DAO or ADO? Here's a DAO code to display the data
Private Sub Member1_DoubleClick()
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase(App.Path & "\sample.mdb")
Set rs = db.OpenRecordset("select * from [USER TABLE] where username='" & txtUserName.Text & "'")
If Not rs.BOF Then
With rs
txtBirthday.Text = !Birthday
txtAddress.Text = !Address
... and so on
End With
End If
End Sub
Private Sub Member1_DoubleClick()
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase(App.Path & "\sample.mdb")
Set rs = db.OpenRecordset("select * from [USER TABLE] where username='" & txtUserName.Text & "'")
If Not rs.BOF Then
With rs
txtBirthday.Text = !Birthday
txtAddress.Text = !Address
... and so on
End With
End If
End Sub
Last edited by jireh; Jul 16th, 2007 at 7:56 pm. Reason: aaa
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
Oh..okay... But i m not using VB.net ..so i thought i will post it in Visual Basic 4/5/6...
itz a forum for troubleshooting problems related to VB 2004/2005and 2006 ...rite Mr. Debasisdas????
and anyways , if u r interested in giving me suggestions related to my problem i wud highly appreciate it but if u just tell me that i have posted it in the wrong forum...u r wasting my time as well as ur time.
itz a forum for troubleshooting problems related to VB 2004/2005and 2006 ...rite Mr. Debasisdas????
and anyways , if u r interested in giving me suggestions related to my problem i wud highly appreciate it but if u just tell me that i have posted it in the wrong forum...u r wasting my time as well as ur time.
enough you two! it won't help if you're arguing on posting, ok dreamer boy I think this issue is already solved. ahm next time please post your problem in one time only don't try to repost it by rephrasing your sentence, please stick to one only, please don't be offended I mean nothing.
regards:
regards:
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
hi jireh...
i also got the same problem...
i'm using ADODB and my access file is in a server.... how can i access the data from that....
i also got the same problem...
i'm using ADODB and my access file is in a server.... how can i access the data from that....
•
•
•
•
You did not stated here how you access your database, Are you using DAO or ADO? Here's a DAO code to display the data
Private Sub Member1_DoubleClick()
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase(App.Path & "\sample.mdb")
Set rs = db.OpenRecordset("select * from [USER TABLE] where username='" & txtUserName.Text & "'")
If Not rs.BOF Then
With rs
txtBirthday.Text = !Birthday
txtAddress.Text = !Address
... and so on
End With
End If
End Sub
•
•
•
•
i tried the code but itz showing type mismatch at thr line
Set rs = db.OpenRecordset("select * from team_details")
plz let me know the problem
or try to put a bracket in the table team_details..
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Set rs = db.OpenRecordset("select * from [team_details]")
Last edited by jireh; Jul 18th, 2007 at 2:37 am.
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
- MS Access 2003 Application Programming (Tech / IT Consultant Job Offers)
- can we connect VB 6 wtih databases in Ms Office Access 2003? (Visual Basic 4 / 5 / 6)
- BDE Alias for ACCESS 2003 User/pwd ?? (C++)
- In which (really) important ways is SQL 2000 better than Access 2003? (MS SQL)
- please take some time to help me.. thank you very much! (C#)
- mid problem in access 2003 (Windows NT / 2000 / XP)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Path without file
- Next Thread: vb and access
| 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






