[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 893
  • Last Modified:

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
0
BeauT
Asked:
BeauT
  • 3
  • 3
1 Solution
 
BeauTAuthor Commented:
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.
0
 
Éric MoreauSenior .Net ConsultantCommented:
Create a connection using the DataEnvironment object and then copy the ConnectionString property. You will then know which parameters you need.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
BeauTAuthor Commented:
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.
0
 
Éric MoreauSenior .Net ConsultantCommented:
You can choose the ODBC driver.

I don't want you to use it! I just want you to create a connection using the DataEnvironment object (using the ODBC driver if you want to) and then look at the connection string that will be generated for you. You can then copy this string into your application!

I often use this technique only to see which parameters I must use. Once I have them all, I remove the DataEnvironment object.
0
 
sudhi022299Commented:
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.
0
 
BeauTAuthor Commented:
ok, I got it to work right. thanks again :-)

Beau
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now