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"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
sCrpPathName = sGet_INI_String("STORAGEPATH", "CrpPath"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
'Data for connection to server and database 1 retrieved
'Initially Databeast (check rpt_sys.ini for current setting)
sDB1Name = sGet_INI_String("DATABASE1", "Name"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
sDB1Server = sGet_INI_String("DATABASE1", "ServerName"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
sDB1User = sGet_INI_String("DATABASE1", "User"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
sDB1Pwd = sGet_INI_String("DATABASE1", "Password"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
'---------------------------------------------------
' --------- 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
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