Solved

VB code to set Oracle service name and address etc.

Posted on 2004-03-23
5
319 Views
Last Modified: 2013-12-25
Is it possible to rest the Oracle service names of my Oracle databases in VB rather than using the Oracle tools net manager etc?
I have an app that needs to point at different db and I'd not have to switch out of the app and to net manager to do it.
0
Comment
Question by:Sparky191
  • 2
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
ajgilbert earned 500 total points
ID: 10657238
Sparky191,

Are all the database SID's are set up in your TNSNAMES.ORA file ?, if they are then switching between databases from VB is easy - you just change the server name in your connection string, and then re-connect to the new database.


0
 
LVL 5

Expert Comment

by:ajgilbert
ID: 10657266
For example, the below will switch an ADO data control between 'database1' and 'database2'

Adodc1.ConnectionString = "Provider=MSDAORA.1;Password=pass;User  ID=user;Data Source=database1;Persist Security Info=True"
Adodc1.Refresh

Adodc1.ConnectionString = "Provider=MSDAORA.1;Password=pass;User ID=user;Data Source=database2;Persist Security Info=True"
Adodc1.Refresh


0
 
LVL 1

Author Comment

by:Sparky191
ID: 10657436
I should clarify. My VB app will configure the connection for another app that uses the database SID's. So I guess just changing that TNSNAMES.ORA file will be all I need to do.
0
 
LVL 1

Expert Comment

by:ajysen
ID: 10677682
i recommend u to use ini file for storing the database name, user name and password. so every time u starts the app, ur app will connect to the database defined in the ini file. For doing so u have to retreive the setting from the ini file.

Also u can change the setting of the ini file through VB app.

Hope this will solve ur problem.
0
 
LVL 1

Author Comment

by:Sparky191
ID: 10698042
Just changing the string works fine thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question