AnvilRanger answer is very good. In addition to it, i'd suggest to start here:
Using ADO with Microsoft Visual Basic[
^]
ADO Code Examples in Visual Basic[
^]
Proper connection string, you'll find here:
http://www.connectionstrings.com/access/[
^]
By the way, such as query:
sql = "Select * From [Security] where Username LIKE '" & Username & "' and Password LIKE '" & password & "'"
is wrong!
Why? Please, have a look here:
Like Operator (Access)[
^]
I'd suggest to change above query to query, which uses
parameters[
^]:
PARAMETERS [uname] CHAR, [pass] CHAR;
SELECT [UserName], [Password]
FROM [Security]
WHERE [UserName] = [uname] and [Password] = [pass]
How to use it?
Declare
ADODB.Command[
^] and
Create Parameter (ADO)[
^] to add it to the command's
Parameters Collection (ADO)[
^]. Finally, call
Execute Method (ADO Command)[
^] to create
ADODB.recordset
.
There are some restrictions for MS Access database, like
list of reserved words[
^], which can't be used.