How to connect Access database to a Visual Studio 2005?

5 pts.
Tags:
ADO
ADODB DSN
Database connectivity
DataSource
DSN
Microsoft Access
VB 2005
Visual Basic
Visual Basic 2005
i use the following code to connect and i created DSN but its not getting connected... whats my fault can anyone help me?? Dim X As ADODB.Connection Dim RS As ADODB.Recordset Dim RS1 As ADODB.Recordset i am getting underlined error in adodb.connection, adodb.recordset i think there is some error in the DSN creation. so anyone please help me to create DSN in the same machine which i am working.
ASKED: October 2, 2008  6:38 AM
UPDATED: June 30, 2011  6:08 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

The compilation error could happen if you have not imported ADODB.

Try adding this (at the beginning):

<pre>Imports ADODB</pre>

I think you also need to set reference to MS ADO objects 2.7 library using Project->Add Reference menu item and then select COM tab.

Once you do this, ADO objects are available and you should be able to see ADODB namespace.

Hope this helps.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Duguchunyang
    Dim X As Odbc.OdbcConnection Dim RS As ADODB.Recordset Dim RS1 As ADODB.Recordset Dim X As Odbc.OdbcConnection Dim RS As ADODB.Recordset Dim RS1 As ADODB.Recordset
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following