vb_dba
Jul 6th, 2001, 10:16 AM
When I define the array arData as below, I receive a type mismatch error when I try to assign a recordset to it using the GetRows Method: arData = RS.GetRows()
If I define the array like: Dim arData, I get a "Subscript out of range: aValues" error. aValues is the "arData" parameter for ShowChart. ShowChart loops through the array and retrieves all of the values and builds a bar graph, but it is having problems using an index w/ arData.
If anyone can help me out, I would appreciate it.
Public Sub CreateChart()
Dim i
Dim arData(100) 'Array For Values
Dim arLabels(100) 'Array For Labels
Set Conn = Server.CreateObject("ADODB.Connection")
With Conn
.CursorLocation = aduseclient
.CommandTimeout = 15
.Open CONN_STRING, UserID, PSWD
End With
SqlStr = ""
SqlStr = SqlStr & "svc_rec_online_BarChart "
SqlStr = SqlStr & "@Rec_From_Date='01/01/01', "
SqlStr = SqlStr & "@Rec_Thru_Date='7/03/01'"
Set RS = Conn.Execute(SqlStr)
arData = RS.GetRows(adGetRowsRest, adBookmarkFirst, "Total")
arLabels = RS.GetRows(adGetRowsRest, adBookmarkFirst, "rec_month")
Set RS = Nothing
Set Conn = Nothing
'Create Barchart
Call ShowChart(arData, arLabels, "Title", "X", "Y")
End Sub
Thanks In Advance,
Chris :(
If I define the array like: Dim arData, I get a "Subscript out of range: aValues" error. aValues is the "arData" parameter for ShowChart. ShowChart loops through the array and retrieves all of the values and builds a bar graph, but it is having problems using an index w/ arData.
If anyone can help me out, I would appreciate it.
Public Sub CreateChart()
Dim i
Dim arData(100) 'Array For Values
Dim arLabels(100) 'Array For Labels
Set Conn = Server.CreateObject("ADODB.Connection")
With Conn
.CursorLocation = aduseclient
.CommandTimeout = 15
.Open CONN_STRING, UserID, PSWD
End With
SqlStr = ""
SqlStr = SqlStr & "svc_rec_online_BarChart "
SqlStr = SqlStr & "@Rec_From_Date='01/01/01', "
SqlStr = SqlStr & "@Rec_Thru_Date='7/03/01'"
Set RS = Conn.Execute(SqlStr)
arData = RS.GetRows(adGetRowsRest, adBookmarkFirst, "Total")
arLabels = RS.GetRows(adGetRowsRest, adBookmarkFirst, "rec_month")
Set RS = Nothing
Set Conn = Nothing
'Create Barchart
Call ShowChart(arData, arLabels, "Title", "X", "Y")
End Sub
Thanks In Advance,
Chris :(