wbstech
asked on
Opening an MS Access Database within a Delphi application
I have a Delphi application which schedules the running of certain Access (2000) databases. Each database has an autoexec macro and performs a variety of functions.
This is running on my work computer though, and so atleast once an hour an MS Access database opens and stops me in the middle of work.
I would like it to open the MS Access databases within a Delphi form, or Delphi element of some sort.
Is this possible? If so, how?
This is running on my work computer though, and so atleast once an hour an MS Access database opens and stops me in the middle of work.
I would like it to open the MS Access databases within a Delphi form, or Delphi element of some sort.
Is this possible? If so, how?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ah should have mentioned, i'm on the ancient Delphi 4.
Each database being opened is running macros and queries of no specific type.
Each database being opened is running macros and queries of no specific type.
ASKER
Would that above code function if I ran the autoexec macro, which in-turn runs multiple macros and queries? That would work for me.
You need to make sure that the office server wrapper is installed first.
You could test the calling of the macros then, but its been a long time since I was using anything near delphi 4 so I couldnt guarentee. All i can suggest is try it out.
You could test the calling of the macros then, but its been a long time since I was using anything near delphi 4 so I couldnt guarentee. All i can suggest is try it out.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, both solutions helped me get to my final code.
If you just want to open the access tables and you have an enterprise version of Delphi you can use the ADO components to do this very easily.
Just drop an ADOCOnnection object onto your form and set the connectionstring (via the wizard in the object inspector).
Turn off LoginPrompt if you don't have to actually login to the database.
Now you can just turn the connection to the access database on and use the standard ADOQueries to run against the new connection to your access database.
If this is not what you are looking for them please provide a little more information.