Hi there
Could anyone out there possibly help me with this query.
I am trying to run a Crystal Report(CR) in VB6 which has an unbound field
object on it.
I am using a ADO recordset with an OLEDB connection to a MS SQL Server 2000
database.
When I try to assign a datasource to the report i get an error saying
"Subscript out of range".
I have created a report called crDelegatedLetter1 which is a ICRDesigner
object.
At the moment I am doing a small test with the event code on the click of a
combobox as follows :
----------------------------------------------------- MY
CODE ------------------------------------------------------------------
Private Sub Combo1_Click()
Dim strCnn As String
Dim rs As New ADODB.Recordset
Dim rpt01 As New crDelegatedLetter1
Dim sQry As String
Connect2DB(* - See Below )
sQry = "SELECT ClaimKey from InsClaim " & _
"WHERE ClaimKey = '" & Combo1.Text & "'"
rs.Open sQry, SQLConn, adOpenKeyset, adLockReadOnly
If Not rs.EOF Then
rpt01.Database.SetDataSource rs (<<<<<<<<<<<<<<<<<<<<<<<<SUBSCRIPT OUT
OF RANGE Error occurs here )
rpt01.ubClaimRef.SetUnboundFieldSource rs("ClaimKey"
End If
CRViewer1.ReportSource = rptDelegatedLetter1
CRViewer1.ViewReport
End Sub
(*) Connect2DB is a public function declared in a module as follows :
Public Const sConnection As String = "Provider=SQLOLEDB.1;Persist Security
Info=False;" & _
"User ID=sa;PWD=sql;Initial
Catalog=INSURANCEUA;Data Source=INSDB"
Sub Connect2DB()
SQLConn.Open (sConnection)
End Sub
-------------------------------------------------END OF MY
CODE ------------------------------------------------------------------
There is one UNbound object field on the report called ubClaimref.
I cannot make out why this error is occurring .
I would be very grateful if anyone could point me in the right direction.
Thanks
Abbey
Could anyone out there possibly help me with this query.
I am trying to run a Crystal Report(CR) in VB6 which has an unbound field
object on it.
I am using a ADO recordset with an OLEDB connection to a MS SQL Server 2000
database.
When I try to assign a datasource to the report i get an error saying
"Subscript out of range".
I have created a report called crDelegatedLetter1 which is a ICRDesigner
object.
At the moment I am doing a small test with the event code on the click of a
combobox as follows :
----------------------------------------------------- MY
CODE ------------------------------------------------------------------
Private Sub Combo1_Click()
Dim strCnn As String
Dim rs As New ADODB.Recordset
Dim rpt01 As New crDelegatedLetter1
Dim sQry As String
Connect2DB(* - See Below )
sQry = "SELECT ClaimKey from InsClaim " & _
"WHERE ClaimKey = '" & Combo1.Text & "'"
rs.Open sQry, SQLConn, adOpenKeyset, adLockReadOnly
If Not rs.EOF Then
rpt01.Database.SetDataSource rs (<<<<<<<<<<<<<<<<<<<<<<<<SUBSCRIPT OUT
OF RANGE Error occurs here )
rpt01.ubClaimRef.SetUnboundFieldSource rs("ClaimKey"
End If
CRViewer1.ReportSource = rptDelegatedLetter1
CRViewer1.ViewReport
End Sub
(*) Connect2DB is a public function declared in a module as follows :
Public Const sConnection As String = "Provider=SQLOLEDB.1;Persist Security
Info=False;" & _
"User ID=sa;PWD=sql;Initial
Catalog=INSURANCEUA;Data Source=INSDB"
Sub Connect2DB()
SQLConn.Open (sConnection)
End Sub
-------------------------------------------------END OF MY
CODE ------------------------------------------------------------------
There is one UNbound object field on the report called ubClaimref.
I cannot make out why this error is occurring .
I would be very grateful if anyone could point me in the right direction.
Thanks
Abbey