Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My ADO Connection to Oracle won't connect

Status
Not open for further replies.
Jan 8, 2001
163
US
A while back I created a moderate size VB 6 application which generates and exports a series of Crystal Reports for a number of our clients. On open of the application, I had created an ADO object which connected to our oracle database and grabbed some general recordset data used to populate some combo boxes on the form.

Friday, my computer died and I had to reinstall everything on my new computer today. Now I keep getting a "Runtime error: ORA-12203 TNS: Unable to connect to destination". I can't figure out how my connection changed from my last computer to my current one. Here's a snippet my code. Can anyone see a problem?


Public adoConn As New ADODB.Connection
Dim sConnectionString As String
Dim strSelPubr As String
Dim strSelAllCorpDates As String


Public adoRecordsetCorpDate As New ADODB.Recordset
Public adoRecordsetAllDates As New ADODB.Recordset
Public adoRecordsetName As New ADODB.Recordset
Public adoRecordsetDate As New ADODB.Recordset
Public adoRecordsetCrystalDate As New ADODB.Recordset
Public adoRecordsetCMCrystalDate As New ADODB.Recordset
Public adoRecordsetPubrCrystalDate As New ADODB.Recordset
Public adoRecordsetName1 As New ADODB.Recordset
Public adoRecordsetRTN As New ADODB.Recordset

Private Sub Form_Load()
'-----------------------------------------------
'---- GETS DATA FROM rpt_sys.ini FILE ----------
'-----------------------------------------------
sPbrPathName = sGet_INI_String("STORAGEPATH", "PbrPath")
sCrpPathName = sGet_INI_String("STORAGEPATH", "CrpPath")

'Data for connection to server and database 1 retrieved
'Initially Databeast (check rpt_sys.ini for current setting)
sDB1Name = sGet_INI_String("DATABASE1", "Name")
sDB1Server = sGet_INI_String("DATABASE1", "ServerName")
sDB1User = sGet_INI_String("DATABASE1", "User")
sDB1Pwd = sGet_INI_String("DATABASE1", "Password")

'---------------------------------------------------
' --------- INITALIZATION OF REPORT SCREEN ---------
'---------------------------------------------------

'The ado connection object is initialized for DB access
sConnectionString = "Provider=MSDAORA.1;Data Source=" & sDB1Name & ";Server=" & sDB1Server & ";User ID=" & sDB1User & ";Password=" & sDB1Pwd & ";Persist Security Info=False"

With adoConn
.ConnectionString = sConnectionString
.CursorLocation = adUseClient
.Open ' < ERRORS RIGHT HERE >
End With

Thanks in Advance,
CrystalVisualBOracle :cool:
 
You may want to check if you have the proper ORACLE client software installed on your development machine. As far as I can remember you need to have that installed in order to connect successfully.
 
Yeah I have that set up okay. I can connect to the oracle databases via Access and Oracle SQL Plus. Thanks for the tip though.

CrystalVisualBOracle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top