|
-
Feb 10th, 2005, 05:50 PM
#1
Thread Starter
New Member
get all information from a username
hi, I am stuck at the point where it will just return whatever information is inside the excel database instead of the ones that relate to the username only.
Excel database
tblLogin
PK_LoginID-autonum (primkey)
Username-text
Password-text
tblTasks
PK_TasksID-autonum
FK_TasksID-num
Date-text
Tasks-text
for my vb application, I set the main form to hide itself and display the login form, once the user log on with the correct username and password, I only need the main form to display information about the username that logged on.
this is my sql statement I used
rstLogin.Open "SELECT * FROM tblLogin, tblTasks, tblMemo WHERE tblLogin.PK_LoginID = tblTasks.FK_TasksID;"...
any idea on how I can solve this problem? thanks for your time.
-
Feb 10th, 2005, 07:53 PM
#2
Re: get all information from a username
Once the user has logged in successfully store their ID then run your SQL query.
VB Code:
"SELECT * FROM tblLogin, tblTasks, tblMemo WHERE USERID = '" & ID & "'"
-
Feb 10th, 2005, 07:56 PM
#3
Fanatic Member
Re: get all information from a username
Your recordset should be like this :
rstLogin.Open "SELECT tblLogin.*, tblMemo.*, tblTasks.*
FROM (tblLogin INNER JOIN tblMemo ON tblLogin.PK_LoginID = tblMemo.FK_TasksID) INNER JOIN tblTasks ON tblLogin.PK_LoginID = tblTasks.FK_TasksID WHERE tblLogin.Username= '" & YourUsernameTextBox.Text & "'"
You wanted to link FK_TasksID with tblMemo, right?
Hope this help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|