?
Solved

VB code to set Oracle service name and address etc.

Posted on 2004-03-23
5
Medium Priority
?
326 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
ajgilbert earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 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