Software FX Posted January 4, 2000 Report Share Posted January 4, 2000 Is Salary a numerical value ? Please try adding the following code before the AdoResultset call ' DataType(0) means the first column in the SQL statement (Salary) ' 2 means CDT_VALUE, 1 means CDT_LABEL Chart.DataType(0) = 2 Chart.DataType(1) = 1 You could also include our CfxIE.inc file so that you can use the symbolic constant names (CDT_VALUE, BAR, etc.) instead of their numerical values Regards, Juan Cegarra Software FX, Inc. http://support.softwarefx.com -----Original Message----- From: Ravi Madhira [ mailto:rmadhira@even.tamuk.edu] Posted At: Sunday, December 26, 1999 4:26 PM Posted To: Server Conversation: Connecting to Database Subject: Connecting to Database Hi, I am new to using chartfx and need some help in accessing data from SQL server. I have used the following code to connect to the database and assign it to Chartfx component using "CHART1.AdoResultset objRS" statment. The recordset "objRS" gets data from the data base which I am able to display in a table, but am not able to assign the data to ChartFx, can any one help. Thanks Ravi <%@ Language=VBScript %> <% ' VI 6.0 Scripting Object Model Enabled %> <!--#include file="_ScriptLibrary/pm.asp"--> <% if StartPageProcessing() Then Response.End() %> <FORM name=thisForm METHOD=post> <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> </HEAD> <BODY> <OBJECT classid=CLSID:5220cb21-c88d-11cf-b347-00aa00a28331> <PARAM NAME ="LPKPATH" VALUE ="/LICENSE/CFXAX.LPK"> </OBJECT> <% Set Conn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.RecordSET") value ="DRIVER=SQL Server;SERVER=TRYSQL;UID=yy;pwd=rabbit;DATABASE=moon" Conn.Open( value) sq = " SELECT Salary, Name FROM Data_Sal Where( Data_Sal.Locname = 'COLUMBIA' AND Data_Sal.Year = 1997)" set objRS = Conn.Execute(sq) SET CHART1 = SERVER.CreateObject("CHARTFX.WEBSERVER") 'TURNS OFF 3D STYLE CHART1.CHART3D = FALSE CHART1.RGBBK = RGB(155,155,755) CHART1.TITLE(2) = " CLAIMS" CHART1.AdoResultset objRS %> <% =CHART1.GETHTMLTAG(500,350) %> Link to comment Share on other sites More sharing options...
Software FX Posted January 4, 2000 Author Report Share Posted January 4, 2000 Is Salary a numerical value ? Please try adding the following code before the AdoResultset call ' DataType(0) means the first column in the SQL statement (Salary) ' 2 means CDT_VALUE, 1 means CDT_LABEL Chart.DataType(0) = 2 Chart.DataType(1) = 1 You could also include our CfxIE.inc file so that you can use the symbolic constant names (CDT_VALUE, BAR, etc.) instead of their numerical values Regards, Juan Cegarra Software FX, Inc. http://support.softwarefx.com -----Original Message----- From: Ravi Madhira [ mailto:rmadhira@even.tamuk.edu] Posted At: Sunday, December 26, 1999 4:26 PM Posted To: Server Conversation: Connecting to Database Subject: Connecting to Database Hi, I am new to using chartfx and need some help in accessing data from SQL server. I have used the following code to connect to the database and assign it to Chartfx component using "CHART1.AdoResultset objRS" statment. The recordset "objRS" gets data from the data base which I am able to display in a table, but am not able to assign the data to ChartFx, can any one help. Thanks Ravi <%@ Language=VBScript %> <% ' VI 6.0 Scripting Object Model Enabled %> <!--#include file="_ScriptLibrary/pm.asp"--> <% if StartPageProcessing() Then Response.End() %> <FORM name=thisForm METHOD=post> <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> </HEAD> <BODY> <OBJECT classid=CLSID:5220cb21-c88d-11cf-b347-00aa00a28331> <PARAM NAME ="LPKPATH" VALUE ="/LICENSE/CFXAX.LPK"> </OBJECT> <% Set Conn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.RecordSET") value ="DRIVER=SQL Server;SERVER=TRYSQL;UID=yy;pwd=rabbit;DATABASE=moon" Conn.Open( value) sq = " SELECT Salary, Name FROM Data_Sal Where( Data_Sal.Locname = 'COLUMBIA' AND Data_Sal.Year = 1997)" set objRS = Conn.Execute(sq) SET CHART1 = SERVER.CreateObject("CHARTFX.WEBSERVER") 'TURNS OFF 3D STYLE CHART1.CHART3D = FALSE CHART1.RGBBK = RGB(155,155,755) CHART1.TITLE(2) = " CLAIMS" CHART1.AdoResultset objRS %> <% =CHART1.GETHTMLTAG(500,350) %> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.