Solved

VB code to set Oracle service name and address etc.

Posted on 2004-03-23
5
316 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Just changing the string works fine thanks
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now