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 

Variants and Catalgs and Connections oh my!

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





PostPosted: Wed Dec 24, 2003 2:11 am    Post subject: Variants and Catalgs and Connections oh my! Reply with quote



What the heck am I doing wrong here?! It bombs out on assigning
ActiveConnection saying "Arguments are of the wrong type, are out of
acceptable range, or are in conflict with one another".

var
ConnectionString: String;
SourceCxn, SourceCatalog: Variant;
begin
...
SourceCxn:=CreateOleObject('ADODB.Connection');
SourceCxn.Open(ConnectionString);
SourceCatalog:=CreateOleObject('ADOX.Catalog');
SourceCatalog.ActiveConnection:=SourceCxn;
...
end;

--
Cheers,
Ignacio
Back to top
DRS
Guest





PostPosted: Thu Dec 25, 2003 5:08 am    Post subject: Re: Variants and Catalgs and Connections oh my! Reply with quote



Ignacio Vazquez <ivazquezATorioncommunications.com> wrote in message
3fe8f619$1 (AT) newsgroups (DOT) borland.com
Quote:
What the heck am I doing wrong here?! It bombs out on assigning
ActiveConnection saying "Arguments are of the wrong type, are out of
acceptable range, or are in conflict with one another".

var
ConnectionString: String;
SourceCxn, SourceCatalog: Variant;
begin
...
SourceCxn:=CreateOleObject('ADODB.Connection');
SourceCxn.Open(ConnectionString);
SourceCatalog:=CreateOleObject('ADOX.Catalog');
SourceCatalog.ActiveConnection:=SourceCxn;
...
end;

First up, why are you late binding (using variants)? Early binding is
*much* faster. You might not notice it so much when you only do one or two
things but when you do heaps the speed difference - up to 20 times - becomes
noticeable. Check out
http://codecentral.borland.com/codecentral/ccweb.exe/getfile?id=15292&filename=unit1.pas,
particularly the procedure called CloseAndReopenDatabase to see early
binding with catalogs and connections.

--

A: Top-posters.
Q: What is the most annoying thing on Usenet?



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.