?
Solved

DSN Less Connection to a access database

Posted on 2002-07-18
3
Medium Priority
?
135 Views
Last Modified: 2010-05-02
Hi

I have a access data base .I need to create a dsnless connection to it.Can anybody help
0
Comment
Question by:Vignette
[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
3 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 7161706
ADO or DAO?

For ADO:

Dim myConn As ADODB.Connection
Set myConn = New ADODB.Connection
myConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\myfolder\mydatabase.mdb;Persist Security Info=False;"
myConn.Open
0
 

Author Comment

by:Vignette
ID: 7161749
One more question befor i give you the points.

How do you get a list of the tables in the access database
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 150 total points
ID: 7161767
Simplest way is this with the above code:

Dim rstTables As ADODB.Recordset
Set rstTables = New ADODB.Recordset
rstTables = myConn.OpenSchema(adSchemaTables)

Then you can use the recordset and the various fields returned such as "CATALOG_NAME", "TABLE_NAME" etc to get the required information.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

801 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