Question : ADO connecting to access database - no named arguments

Hello experts,

I'm running a vb .net program that is accessing an Access 2007 database.   I'm having an issue though connect to the database however using ADO.   Please see the code and attachment screenshot of the error  for more detail.   Any insight or help on what the problem will be greatly appreciated.   Thanks in advance.

Dim db As New ADODB.Connection
Dim cmdcommand As New ADODB.Command
Dim rs As New ADODB.Recordset

'ERROR OUT AT THIS LINE AND GOING TO CATCH STATEMENT
db.rs = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\Administrator\My Documents\Dep.accdb"


...
....
...

Catch ex As Exception

            Debug.WriteLine(ex.Message)

Answer : ADO connecting to access database - no named arguments

instead of:

db.rs = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\Administrator\My Documents\Dep.accdb"

try:
db.open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\Administrator\My Documents\Dep.accdb"
Random Solutions  
 
programming4us programming4us