 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
D Whaley Guest
|
Posted: Wed Jan 26, 2005 8:01 pm Post subject: New Access Query |
|
|
How do I create a new Query in Access using OLE.
If there is a way using ADO, I would prefer it.
|
|
| Back to top |
|
 |
D Whaley Guest
|
Posted: Thu Jan 27, 2005 9:39 pm Post subject: Re: New Access Query |
|
|
I figured it out using Com Objects, it could easily be done using Type
Libraries or Server Objects also.
In case anyone else could use this...
// Add ComObj & Variants to Uses
Procedure AddQueryToAccess(DBName, QueryName, QueryText: String);
var
Access: Variant;
begin
Access := CreateOleObject('Access.Application');
Access.OpenCurrentDatabase(DBName, False);
Access.CurrentDb.CreateQueryDef(QueryName, QueryText);
Access.Quit($00000001); // $00000001 = Save All Changes
End;
"D Whaley" <dwhaley (AT) hs-technologies (DOT) com> wrote
| Quote: | How do I create a new Query in Access using OLE.
If there is a way using ADO, I would prefer it.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|