Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor
27 Posts
0 Kudos
Registered: ‎01-26-2005
Post 1 of 7

ADOLISP ADO-AttDB returns Can't connect dialog

366 Views, 6 Replies
07-14-2011 02:09 PM

** I originally posted this in the ASE forum, but moved it here since it applies to AutoLisp.

 

Hi,

I am trying out ADOLISP. When I enter ADO-AttDB?, a dialog says:

Can't connect the the database using "Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\InstallCAD\acad\Databases\ADO Lisp\AttDB Test.mdb"
logging as "admin" with password ""?

I checked to make sure the .mdb file exists in said folder.

Maybe the SQL driver? If so, how do I check that?

I'm on XP SP3, autocad 2004

Please help.

Thanks,
Chris


ADN Support Specialist
37 Posts
3 Kudos
Registered: ‎05-25-2011
Post 2 of 7

Re: ADOLISP ADO-AttDB returns Can't connect dialog

07-20-2011 09:41 AM in reply to: GuitarLover

Hi Chris,

 

   I'd suggest to try the same connection string from a different program, like Excel etc.

   If you system is 64-bit, it also can be the source of the problem.



Marat Mirgaleev
Developer Technical Services
Autodesk Developer Network
Active Contributor
27 Posts
0 Kudos
Registered: ‎01-26-2005
Post 3 of 7

Re: ADOLISP ADO-AttDB returns Can't connect dialog

07-20-2011 12:00 PM in reply to: Marat.Mirgaleev

Marat,

 

Thanks for your response.

 

I am using 32-bit XP SP3.

 

I am a total noob. If I do your suggestion in Excel, can I use vba? Would you give me a quick example?

 

Also, what will this step tell me?

Distinguished Mentor
582 Posts
91 Kudos
Registered: ‎04-11-2010
Post 4 of 7

Re: ADOLISP ADO-AttDB returns Can't connect dialog

07-20-2011 02:02 PM in reply to: GuitarLover

Hi,

 

Check this web site: http://www.connectionstrings.com/

 

-gnb

Mentor
291 Posts
2 Kudos
Registered: ‎03-15-2007
Post 5 of 7

Re: ADOLISP ADO-AttDB returns Can't connect dialog

07-20-2011 05:55 PM in reply to: GuitarLover

This works for me.

 

(setq fnd (getfiled "Select a Database" "c:\\yourdatabasepath\\" "mdb" 0));choose your .mdb file
(setq ConnectString (strcat "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" fnd ";Persist Security Info=False"))

 

hth

Southie

ADN Support Specialist
37 Posts
3 Kudos
Registered: ‎05-25-2011
Post 6 of 7

Re: ADOLISP ADO-AttDB returns Can't connect dialog

07-21-2011 02:00 AM in reply to: GuitarLover

Hi,

 

   Yes, VBA would be fine.

   If the connection string does NOT work in Excel, that means that you have a problem: - with the connection string itself; - or with your database file; - or with the database driver.

   If it works in Excel, it will mean that the problem is with AutoCAD and Lisp.

 



Marat Mirgaleev
Developer Technical Services
Autodesk Developer Network
Distinguished Contributor
309 Posts
4 Kudos
Registered: ‎10-02-2003
Post 7 of 7

Re: ADOLISP ADO-AttDB returns Can't connect dialog

08-09-2011 02:03 AM in reply to: Marat.Mirgaleev

Could it simply be that you need the double-backslash in your file path?

 

ie.     C:\\InstallCAD\\acad\\Databases\\ADO Lisp\\AttDB Test.mdb

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!