Hello,
I use this script to connect to oracle 8i but now that we have updated to oracle 9i this script breaks its not able to connect. I am not sure what I need to change.
I believe my ADOBD connections need to be changed but not sure..
thanks
Niki



Public Sub afterPlay()
On Error GoTo norec_err
'Declare a variable to initiate connectivity to database
Dim rs As ADODB.recordset
Dim conn As New ADODB.Connection

'Declare variables used for connecting and defining data source
Dim query As String
Dim dsName As String
Dim dbUser As String
Dim dbPassword As String
Dim recRow As String
Dim i As Integer

'Query the database
query = "SELECT * FROM QSN_APP.TDATACAPTURE WHERE CREATEDDATE >= (sysdate-(3/(24*60)))"
dsName = "connectto"
dbUser = "username"
dbPassword = "password"

'Open a database connection
Call conn.Open(dsName, dbUser, dbPassword)
'Execute Sql query
Set rs = conn.Execute(query)

'Declare variables and instantiate a file object for us to write dbase records to a file
'Dim fso As FileSystemObject: Set fso = New FileSystemObject
'Dim tstream As TextStream
'Dim writePath As String
'Dim counter As Integer
'writePath = "P:\Automation\verify.txt"

'Pass the parameters expected by the OpenTextFile object.
'Write to a file
Set tstream = fso.OpenTextFile(writePath, ForAppending, True)
'Iterate through the records and write to file
Do Until rs.EOF Or rs.BOF
For i = 0 To rs.Fields.Count - 1
recRow = recRow & rs(i) & ","
Next i
If (rs.Fields("STATIC02").Value <> "") And (rs.Fields("STATIC04").Value <> "") Then
verifyFieldsshared.globalvars.newDbFirst = rs.Fields("STATIC02").Value + verifyFieldsshared.globalvars.ownerFirst
verifyFieldsshared.globalvars.newDbLast = rs.Fields("STATIC04").Value + verifyFieldsshared.globalvars.ownerLast
If (verifyFieldsshared.globalvars.newDbFirst = verifyFieldsshared.globalvars.fnamedb And verifyFieldsshared.globalvars.newDbLast = verifyFieldsshared.globalvars.lnamedb) Then
tstream.WriteLine "Databank Name: " & verifyFieldsshared.globalvars.fnamedb & " " & verifyFieldsshared.globalvars.lnamedb & " " & "== " & "Corresponding persistent Data: " & recRow & vbLf
Call p.RSWApp.WriteToLog("Writing record to database... -------->", rs.Fields(0).Value, rs.Fields("DATACAPTURESTATUS2TCODE").Value)
recRow = ""
rs.MoveNext
Else
recRow = ""
rs.MoveNext
End If
norec_err:
Select Case (Err)
Case 3021 ' No current record
Exit Sub
End Select
End If
Loop
'Terminate connection to database
tstream.Close
Call conn.Close

End Sub