Question

Asked:
Asked By:
Oct 2 2008   6:38 AM GMT
Rajeshbnp2000   5 pts.

How to connect Access database to a Visual Studio 2005?


Visual Basic, Microsoft Access, VB 2005, ADO, Visual Basic 2005, Database connectivity, DSN, DataSource, ADODB DSN

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.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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

Try adding this (at the beginning):

Imports ADODB


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.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development and Database.

Looking for relevant Development Whitepapers? Visit the SearchWinDevelopment.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register