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 

TConnection.Open question

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





PostPosted: Mon Apr 23, 2007 8:11 am    Post subject: TConnection.Open question Reply with quote



Hi,

I've imported the ADO 2.6 type library into Delphi 6 and successfully gotten
it to work. (This is for use with a legacy application.)

However, the MS documentation says that all of the parameters on the
connection open method are optional. Indeed, I'm used to setting the
connection properties instead of using the open; specifically with the user
ID and password in the connection that I retrieve from an ini file.

However, this is the only definition of the open in the imported type
library:

Procedure TConnection.Open(Const ConnectionString: WideString; Const
UserID: WideString;
Const Password: WideString; Options: Integer);

That is, there is no implementation without the parameters.

So, is there something I can pass, maybe a null string or NIL, that tells
ADO the parameter is not there or do I have to pass everything in the open,
thus making the various properties irrelevant.

Gary
Back to top
Brian Bushay TeamB
Guest





PostPosted: Wed Apr 25, 2007 7:46 am    Post subject: Re: TConnection.Open question Reply with quote



Quote:
However, this is the only definition of the open in the imported type
library:

Procedure TConnection.Open(Const ConnectionString: WideString; Const
UserID: WideString;
Const Password: WideString; Options: Integer);

That is, there is no implementation without the parameters.

So, is there something I can pass, maybe a null string or NIL, that tells
ADO the parameter is not there or do I have to pass everything in the open,
thus making the various properties irrelevant.

try EmptyParam


--
Brian Bushay (TeamB)
Bbushay (AT) NMPLS (DOT) com
Back to top
Gary Wardell
Guest





PostPosted: Thu May 03, 2007 6:51 am    Post subject: Re: TConnection.Open question Reply with quote



Quote:

try EmptyParam



That gives this error:

Could not convert variant of type (Error) into type (Integer)
Back to top
Brian Bushay TeamB
Guest





PostPosted: Fri May 04, 2007 8:11 am    Post subject: Re: TConnection.Open question Reply with quote

Quote:
That gives this error:

Could not convert variant of type (Error) into type (Integer)

Try 0 for the last parameter

--
Brian Bushay (TeamB)
Bbushay (AT) NMPLS (DOT) com
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.