I have made an application with access database using Adodc and it works fine.

However, I have set the ConnectionString and RecordSource in the Properties window in VB6. But now I want to write it in the Code.

I need some help. I have written the code and need someone to correct it.

Name of Adodc control is DBase


DBase.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\APP\Database.mdb;Persist Security Info=False"
DBase.RecordSource = "Table"

Please find out the connection strings here.

Thanks that's a useful site.

However, when I run the program, I get Run-time error 91
"Object variable or With block variable not set"

All I am doing is:

Dim DBase As Adodc

DBase.ConnectionString = "String here"
DBase.RecordSource = "Access DB Table Name"