Solved

VB code to set Oracle service name and address etc.

Posted on 2004-03-23
5
317 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

867 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

12 Experts available now in Live!

Get 1:1 Help Now