Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Databases from AutoCAD

Status
Not open for further replies.

pixelrat

Technical User
Jul 19, 2003
1
GB
I'm having problems opening databases from AutoCAD. I've tried it with a number of Microsoft Access files, but with no luck.

I created a data link, using Microsoft Jet 4.0 OLE DB Provider. I tested the connection & got "Test Connection Suceeded"

However, when I try to open a database from AutoCAD, I get the following:

Connection Failure

Can't connect to "Data Link"

The connect could have failed due to an incorrectly
entered user name or password, or because the data
source configuration file is no longer valid. Choose
configure to edit the data source configuration file, or
Close to dismiss this dialog box.

Database Error Information

Error: SQL-client unable to establish SQL
connection
Error: Multiple-step OLE DB operation generated
errors. Check each OLE DB status value, if
available. No work was done.

I've double-checked, & as far as I can tell, I've done everything properly.
Can anyone throw some light on this?

Cheers
 
I have had great success with Microsoft Access controlling AutoCAD using VBA commands
NOTE: In Access Visual Basic editor you "HAVE" to set e reference to AutoCAD In "Tools" menu then "References" you wil see the ACAD libary there, check the box.
Here are the basics
'--------------- Must have this stuff --------------------

' Set up variables for AutoCAD
Dim objAcadApp As AcadApplication
Dim ThisDrawing As AcadDocument
' Find instance of AutoCAD 2000
Set objAcadApp = GetObject(, "AutoCAD.Application.15") ' AutoCAD 2000
Set ThisDrawing = objAcadApp.ActiveDocument

'--------------- Open a drawing --------------------

ThisDrawing.Application.Documents.Open CommonDialog1.FileName
objAcadApp.Visible = True


'--------------- Zoom all --------------------------

ThisDrawing.Application.ZoomAll



DougP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top