 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Stacey R. Brodsky Guest
|
Posted: Tue Feb 24, 2004 3:49 pm Post subject: What am I missing? |
|
|
Hi All,
I am new to Ado. I am using MSJet 4.0, Access DB. In my thread on .Execute,
I have the following lines :
OleInitialize(nil);
Catalog := CreateCOMObject(StringToGUID('ADOX.Catalog')) as _Catalog;
But, I don't see anywhere where I am cleaning this up, ie. Freeing or niling
the Catalog, or maybe there is an OleUnInitialize(nil) command? All I know
is that ever since I put this code into my thread, I am throwing strange
AV's randomly, at different places in my thread. Even though I am not even
using the Catalog.
Any suggestions, TIA,
Stacey
--
Regards,
Stacey R. Brodsky
ClubRunner, Inc.
www.clubrunner.net
Disclaimer:
Any included code snippets may not have been previously tested.
|
|
| Back to top |
|
 |
Viatcheslav V. Vassiliev Guest
|
Posted: Tue Feb 24, 2004 5:37 pm Post subject: Re: What am I missing? |
|
|
Use CoInitialize(nil) in thread, not OleInitialize. You free Catalog by
setting it to nil. At the end of the thread Execute function you should
uninitialize COM with CoUninitialize().
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Stacey R. Brodsky" <sbrodsky68@^nospam^aol.com> сообщил/сообщила в новостях
следующее: news:403b7243 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi All,
I am new to Ado. I am using MSJet 4.0, Access DB. In my thread on
..Execute,
I have the following lines :
OleInitialize(nil);
Catalog := CreateCOMObject(StringToGUID('ADOX.Catalog')) as
_Catalog;
But, I don't see anywhere where I am cleaning this up, ie. Freeing or
niling
the Catalog, or maybe there is an OleUnInitialize(nil) command? All I know
is that ever since I put this code into my thread, I am throwing strange
AV's randomly, at different places in my thread. Even though I am not even
using the Catalog.
Any suggestions, TIA,
Stacey
--
Regards,
Stacey R. Brodsky
ClubRunner, Inc.
www.clubrunner.net
Disclaimer:
Any included code snippets may not have been previously tested.
|
|
|
| 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
|
|