Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Charts

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-09-24 : 08:43:49
Efrain writes "Please help.

Why I can't plot a Graph from a SQL recordset as I can do it with MSAccess?
Here is the code:

Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sqlstr As String

conn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DB-NAME;Data Source=SERVER-NAME"
conn.Open

sqlstr = "select * from TABLE-NAME where FIELD='VALUE'"
rs.Open sqlstr, conn, adOpenKeyset, adLockOptimistic

Set MSChart1.DataSource = rs

If copy and paste it and try it with MSACCESS (Connection and table) will work.

SQL SERVER 2000 8.00.194
VB 6
MDAC 2.8

or if you experience the same (no good), any suggestions will be appreciated!

Thanks,
Efrain."
   

- Advertisement -