• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 153
  • Last Modified:

ODBC Connection to an Access database

I have created a ODBC name under the System DSN called 'Ready'.
I am unable to connect to this database using the OpenDatabase method of DAO.
my database file name is readyData.mdb
The syntax which I have written is as below:

Set g_db = Workspaces(0).OpenDatabase("Ready",False,False,"ODBC;DSN=Ready;UID=;PWD;")

Can anybody please help me to connect to this database using ODBC;

Thanking you.
  • 2
1 Solution
You have to correct the syntax actually.
Set g_db = Workspaces(0).OpenDatabase("Ready",False,False,"ODBC;DATABASE = readydata ;UID=;PWD;DSN=Ready")

is the correct syntax

Also check second and third parameters values from VB help whether you need false or something else depending on your requirements
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now