Link to home
Start Free TrialLog in
Avatar of BeauT
BeauT

asked on

Using .Properties("Prompt")

OK, I am connecting to Oracle8 through ADO 2.1 and I used a code sample to get myself up and running. In this code sample, this code was used:

'Displays a prompt for Service, Username and password
.Properties("Prompt") = adPromptAlways

I seem to be stuck with this though. When I try to assign a different constant(like adPromptNever) or remove this line altogether, I get this error: "TNS:unable to connect to destination"

What I'd really like is to bypass the prompt because this app is supposed to run on a schedule, usually at night after everyone has gone home. Thanks for any help.

Beau
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Avatar of BeauT
BeauT

ASKER

Those didn't really help.  I have tried setting:
..Properties("Prompt") = adPromptNever

and it gives me an error, even when I have all the data needed(I think?) in my connection string.  My connection string looks like this:

"DRIVER={Oracle ODBC Driver};SERVER=AAA;UID=MyUID;PWD=MYPWD;DATABASE=AAA"
The server and database use the same string because I'm not actually sure which one is necessary. And it still yields a working connection. But I need to now get rid of the prompt altogether.
Create a connection using the DataEnvironment object and then copy the ConnectionString property. You will then know which parameters you need.
Avatar of BeauT

ASKER

That won't really work for me. I'm using the Oracle ODBC driver, which is not an available driver in the DataEnvironment. Also, I am using a DSN-less connection.
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In Oracle use specify the connect string which is required along with a username and a password.
This connect string in ODBC could be specified by the "server" property.


Regards,
Sudhi.
Avatar of BeauT

ASKER

ok, I got it to work right. thanks again :-)

Beau