Unable to reload data from DB

TeeChart for ActiveX, COM and ASP
Post Reply
Pep
Site Admin
Site Admin
Posts: 3301
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Nov 24, 2003 10:04 am

Hi,

>I tried everything...nothings work. Setting the dataset in design-time, >changing the data on the DB and using all refresh/reload method I could >find...nothings work.

Which TeeChart Pro version are you using ?
I remember there was a problem with the CheckDataSource method in the TeeChart Pro v5.0.3.1. And a workaround was to update the Chart using :
rst.Update
TChart1.Series(0).DataSource = rst
rst.Close
i.e. relinking the RecordSet to the Chart.

>Also, when I use the DataSource method it freeze for about 20 seconds.
To add points to a chart quickly you can set the ITChart.AutoRepaint
property to false (see the TeeChart 5 Help for further details). Then once you've added it set it to true.


>Now, using this following code...no data is shown on the graph.
You should add the ISeries.CheckDataSource.


Ex :

Dim strSQL1 as String

strSQL1 = "select * from live_chartData"

With TChartML

Set rst1 = CreateObject("ADODB.Recordset")
Set Conn = CreateObject("ADODB.Connection")
Conn.Open "DSN=itant; User Id=blah;Password=blah;"

rst1.Open strSQL1, Conn, 1, 1
With .Series(0)
.DataSource = rst1
.LabelsSource = "points"
.YValues.ValueSource = "#Sum#stake"
.XValues.ValueSource = "points"
.CheckDataSource
End With

rst1.Close
Conn.Close


Best Regards !
Josep Lluis Jorge
http://support.steema.com

Post Reply