How can I bound ms chart to ADO Recordset?

G

Guest

I can bound forms to ado record set
I can bound bombo box to ado recordset
I can bound list box to ado recordset

I tried to folow the same logical that I used for list box but in charts
doesn't work.

Any sugestions?

PS. I'm usign adp in access 2003 vs sql server 2000
Thanks,

Example to bound bombo box to ado recordset.

Private Sub Form_Open(Cancel As Integer)
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

'Create a new ADO Connection object
Set cn = New ADODB.Connection
With cn
.Provider = "MSDAORA"
.Properties("Data Source").Value = "MyOracleServer"
.Properties("User ID").Value = "username"
.Properties("Password").Value = "password"
.Open
End With

'Create an instance of the ADO Recordset class, and
'set its properties
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = "SELECT * FROM Customers"
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.Open
End With
'Set the form's Recordset property to the ADO recordset
Set Me.Recordset = rs
Set rs = Nothing
Set cn = Nothing
End Sub

JC
 
D

dbahooker

I'd juse the 'office web components' instead of the MS Chart.

I mean; it's a LOT more powerful; you can bind it ot a pivotTable for
example.

-Aaron
 
G

Guest

Jose Perdigao said:
I can bound forms to ado record set
I can bound bombo box to ado recordset
I can bound list box to ado recordset

I tried to folow the same logical that I used for list box but in charts
doesn't work.

Any sugestions?

PS. I'm usign adp in access 2003 vs sql server 2000
Thanks,

Example to bound bombo box to ado recordset.

Private Sub Form_Open(Cancel As Integer)
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

'Create a new ADO Connection object
Set cn = New ADODB.Connection
With cn
.Provider = "MSDAORA"
.Properties("Data Source").Value = "MyOracleServer"
.Properties("User ID").Value = "username"
.Properties("Password").Value = "password"
.Open
End With

'Create an instance of the ADO Recordset class, and
'set its properties
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = "SELECT * FROM Customers"
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.Open
End With
'Set the form's Recordset property to the ADO recordset
Set Me.Recordset = rs
Set rs = Nothing
Set cn = Nothing
End Sub

JC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top