BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

What am I missing?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Stacey R. Brodsky
Guest





PostPosted: Tue Feb 24, 2004 3:49 pm    Post subject: What am I missing? Reply with 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
Viatcheslav V. Vassiliev
Guest





PostPosted: Tue Feb 24, 2004 5:37 pm    Post subject: Re: What am I missing? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.