 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ignacio Vazquez Guest
|
Posted: Wed Dec 24, 2003 2:11 am Post subject: Variants and Catalgs and Connections oh my! |
|
|
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
|
Posted: Thu Dec 25, 2003 5:08 am Post subject: Re: Variants and Catalgs and Connections oh my! |
|
|
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 |
|
 |
|
|
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
|
|