Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ODBC Connection to an Access database

Posted on 1999-06-22
2
Medium Priority
?
149 Views
Last Modified: 2010-05-02
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.
0
Comment
Question by:umeshkhoje
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
apratima earned 200 total points
ID: 1519009
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



0
 
LVL 1

Expert Comment

by:apratima
ID: 1519010
Also check second and third parameters values from VB help whether you need false or something else depending on your requirements
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question