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

Code:

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.

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"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.