943,844 Members | Top Members by Rank

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

Problem with retrieving data from access 2003

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dreamerboy is offline Offline
19 posts
since Jul 2007
Jul 16th, 2007
0

Re: Problem with retrieving data from access 2003

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
Last edited by jireh; Jul 16th, 2007 at 7:56 pm. Reason: aaa
Reputation Points: 11
Solved Threads: 49
Posting Whiz
jireh is offline Offline
316 posts
since Jul 2007
Jul 17th, 2007
0

Re: Problem with retrieving data from access 2003

As you are using Visual Basic 2005 as Front-end ,you should have posted the question in VB.NET forum .
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Jul 17th, 2007
0

Re: Problem with retrieving data from access 2003

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dreamerboy is offline Offline
19 posts
since Jul 2007
Jul 17th, 2007
0

Re: Problem with retrieving data from access 2003

VB 2004 and 2006 .........

my god what is that.

some one please tell this boy this forum is for VB 4.0 / 5.0 / 6.0 not for 2004,2005 2006
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Jul 17th, 2007
0

Re: Problem with retrieving data from access 2003

well thank you Debasis...m a NOVICE in this field
appreciate ur HELP !
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dreamerboy is offline Offline
19 posts
since Jul 2007
Jul 17th, 2007
0

Re: Problem with retrieving data from access 2003

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:
Reputation Points: 11
Solved Threads: 49
Posting Whiz
jireh is offline Offline
316 posts
since Jul 2007
Jul 18th, 2007
0

Re: Problem with retrieving data from access 2003

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....


Click to Expand / Collapse  Quote originally posted by jireh ...
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
Reputation Points: 10
Solved Threads: 3
Light Poster
guru511 is offline Offline
42 posts
since Jul 2007
Jul 18th, 2007
0

Re: Problem with retrieving data from access 2003

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
Reputation Points: 10
Solved Threads: 3
Light Poster
guru511 is offline Offline
42 posts
since Jul 2007
Jul 18th, 2007
0

Re: Problem with retrieving data from access 2003

Click to Expand / Collapse  Quote originally posted by guru511 ...
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
please check the table team_details maybe it is mispelled...

or try to put a bracket in the table team_details..
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Set rs = db.OpenRecordset("select * from [team_details]")
Last edited by jireh; Jul 18th, 2007 at 2:37 am.
Reputation Points: 11
Solved Threads: 49
Posting Whiz
jireh is offline Offline
316 posts
since Jul 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

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: Path without file
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: vb and access





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


Follow us on Twitter


© 2011 DaniWeb® LLC