 |
cempaka Level: Big Cheese
 Registered: 03-03-2009 Posts: 19
|
to check column from primary key
hi all..
im a newbie in VB
i am doing a project on access door with fingerprint..but not all person in the database can enter all door....certain doors for certain people..
how can i check another column in the database after i prompt for the primary key?
for example, entering the office..i want to check what is the position in the company. i prompt for the ID number first. then, from the person's ID number, i want to check other column from the same table..
how do i code it?
thanks a lot..
|
|
03-03-2009 at 09:09 AM |
|
|
cempaka Level: Big Cheese
 Registered: 03-03-2009 Posts: 19
|
Re: to check column from primary key
thanks geoff
i tried the code.
but still failed..
can somebody help me..in this part..
the database table name is User.
InputUser is the input from the user after promted from inputBox.
the level id shows the permission. if the level id is "1", then he/she allowed to enter.
Dim sSQL As String
sSQL = "SELECT User.Level_ID FROM User WHERE (User.User_ID = " & InputUser & ")"
If Level_ID = "1" Then
MsgBox "YES.YOUR ACCESS IS GRANTED!"
Else
MsgBox "SORRY. YOUR ACCESS IS DENIED"
End If
|
|
10-03-2009 at 03:51 PM |
|
|
cempaka Level: Big Cheese
 Registered: 03-03-2009 Posts: 19
|
Re: to check column from primary key
thanks geoff..
actually the User and User_ID is just example..
because i'm using malay for my database..thats why i replace the word with english..
for 1 door, i manage to edit the coding..
but for another door, i dont know why it doesnt work even i use the same coding..
this is for the door that i manage to make it..
sSQL = "select * from DoorUser where DoorUser_ID = " & InputDoor1 & ""
rs.Open sSQL, cn, adOpenDynamic, adLockOptimistic
If rs!level_id = "1" Then
MsgBox "YES.YOUR ACCESS IS GRANTED!"
Else
MsgBox "SORRY. YOUR ACCESS IS DENIED"
End If
but for another door, i copy the same coding but it was failed.
sSQL = "select * from DoorUser where DoorUser_ID = " & InputDoor2 & ""
rs.Open sSQL, cn, adOpenDynamic, adLockOptimistic
If rs!Position_ID <> "NormalUser" Then
MsgBox "YES.YOUR ACCESS IS GRANTED!"
Else
MsgBox "SORRY. YOUR ACCESS IS DENIED"
End If
thanks..
|
|
11-03-2009 at 04:38 PM |
|
|
cempaka Level: Big Cheese
 Registered: 03-03-2009 Posts: 19
|
Re: to check column from primary key
hi there..
sorry for late feedback..
i'd settled my problem after i replaced the 'space' with 'underscore'..
thanks to all..
my next problem is i do not know how to connect the device to my application..
i bought a fingerprint scanner with smart card reader..
but the authentication will be done only between live fingerprint with the fingerprint stored in the smart card..
my question is:
1) how can i modify the source code to be used in my application
2) how to move the data after checked in the database to the smart card?
thanks...
|
|
17-03-2009 at 11:13 AM |
|
|
|
|
 |
 |