![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2006
Posts: 1
Rep Power: 0
![]() |
Obtaining information from an Access Database in VB
Hello, I am working on a Visual Basic program that has to go "behind the scenes" and confirm an Employee ID and Employee Password. The database name is EmployeeList, and is written in Access. So, how would I write this in my visual basic code? The button is a "Continue" button after entering the Employee ID and Password.
Pretty much what I'm trying to do is comparable to a log in screen. I just need to go out and verify if the user's information is correct. :/ So, any tutorials anyone knows of on how to do this, or could anyone give me some code, and explain the code? I dont just want the code, I want to understand it also. ^^; |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Aug 2005
Location: Romania
Posts: 13
Rep Power: 0
![]() |
To connect to Access databases, you can use System.Data.OleDb. Set the Provider in the Connection to "Microsoft.Jet.OLEDB.4.0" and the Data Source to the name of the database file. Since Access supports basic SQL features, you can use a command like "Select [Employee ID] From [Employee table] Where [Employee ID] = '" & EmployeeIDTextBox.Text.Replace("'", "''") & "' And ..." (similar for password). (One would normally use Parameters, but I think that replacing quotes is enough for Access.)
However, this will only provide formal security (someone could use Access). You could ask the user the password to the database itself, then connect. You should read the .NET Framework SDK and Platform SDK sections about data access. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|