Jump to content
Software FX Community

ADO Help


Software FX

Recommended Posts

Any chance that someone (anyone) could give me a snippet of code that

actually WORKS when you call AdoResultSet? I have a good resultset from my

database and the chart will render whenever I loop through the recordset and

set the values manually, but AdoResultSet doesn't work, hasn't worked and

I'm concerned that it's just not going to work. (Do I sound suffieicntly

frustrated?)

Note the commented section in the middle of the code. When I remove the

AdoResultSet bit and uncomment that code, the chart will render, which is

hunky-dorey and all but doesn't help me because I bought this tool for

dynamic chart generation for unknown datasets.

Help, please.

Christopher Tackett

--- CODE ---

<!-- #include virtual="/Include/CfxIE.inc" -->

<HTML>

<BODY>

<% Set conn = Server.CreateObject("ADODB.Connection")

conn.Open "DSN=atlas;UID=atlas;PWD=atlas;"

Set myRecordset = conn.Execute("SELECT count(id_antenna) Value, id_structure

label from atlas.antenna where rownum < 50 group by id_structure")

Set chart = Server.CreateObject("ChartFX.WebServer")

chart.DataType(0) = CDT_VALUE

chart.DataType(1) = CDT_LABEL

chart.RgbBk = RGB(255,255,255)

chart.Chart3D = False

chart.AxesStyle = CAS_FLATFRAME

'Chart.OpenDataEx COD_VALUES,1,myRecordset.RecordCount

'

'idx = 0

'While Not myRecordset.EOF

'

' Chart.ValueEx(0,idx) = myRecordset("Value")

' Chart.Legend(idx) = myRecordset("Label")

'

' idx = idx + 1

' myRecordset.MoveNext

'

'Wend

'

'Chart.CloseData COD_VALUES

chart.AdoResultSet myRecordset

Chart.Axis(AXIS_Y).Max = 4

Chart.Gallery = BAR

%>

<%= chart.GetHtmlTag("90%","90%") %>

</BODY>

</HTML>

Link to comment
Share on other sites

If you connect to http://support.softwarefx.com/cfxie and select the ASP

samples area you will see many samples, some of the connecting to database

(there is one at Data Related\Connecting to a database) the code shown in

each one of the samples is the code that is actually running.

Your code looks fine, I would have to ask you what kind of fields are you

selecting in your recordset and what kind of database are you connecting to.

Have you tried other tables/fields ? Most of our customers use AdoResultset

and we have supported this method since ChartFX IE 3.5 so this code has been

tested quite enough, I have personally tested SQLServer (6, 7, 2K), Access,

Stored procedures, disconnected recordsets read from XML, etc.

One thing you may want to check is whether you have a file named

SfxAdoAut.dll in your machine, this DLL is used to read data from ADO, you

may want try registering this DLL (regsvr32) and restarting IIS. I have seen

a situation where a Microsoft recommended fix will disable registry entries

that point to "extended file names" (file names with more that 8 letters).

If this is your case you may need to rename the DLL, register it and then

restart IIS.

--

Regards

JC

Software FX Support

"Christopher Tackett" <softwarefx@tackettproxy.com> wrote in message

news:hx6lMAX7BHA.1268@webserver1.softwarefx.com...

> Any chance that someone (anyone) could give me a snippet of code that

> actually WORKS when you call AdoResultSet? I have a good resultset from

my

> database and the chart will render whenever I loop through the recordset

and

> set the values manually, but AdoResultSet doesn't work, hasn't worked and

> I'm concerned that it's just not going to work. (Do I sound suffieicntly

> frustrated?)

>

> Note the commented section in the middle of the code. When I remove the

> AdoResultSet bit and uncomment that code, the chart will render, which is

> hunky-dorey and all but doesn't help me because I bought this tool for

> dynamic chart generation for unknown datasets.

>

> Help, please.

>

> Christopher Tackett

>

> --- CODE ---

> <!-- #include virtual="/Include/CfxIE.inc" -->

> <HTML>

> <BODY>

> <% Set conn = Server.CreateObject("ADODB.Connection")

> conn.Open "DSN=atlas;UID=atlas;PWD=atlas;"

> Set myRecordset = conn.Execute("SELECT count(id_antenna) Value,

id_structure

> label from atlas.antenna where rownum < 50 group by id_structure")

>

> Set chart = Server.CreateObject("ChartFX.WebServer")

>

> chart.DataType(0) = CDT_VALUE

> chart.DataType(1) = CDT_LABEL

>

> chart.RgbBk = RGB(255,255,255)

> chart.Chart3D = False

> chart.AxesStyle = CAS_FLATFRAME

>

> 'Chart.OpenDataEx COD_VALUES,1,myRecordset.RecordCount

> '

> 'idx = 0

>

> 'While Not myRecordset.EOF

> '

> ' Chart.ValueEx(0,idx) = myRecordset("Value")

> ' Chart.Legend(idx) = myRecordset("Label")

> '

> ' idx = idx + 1

> ' myRecordset.MoveNext

> '

> 'Wend

> '

> 'Chart.CloseData COD_VALUES

>

> chart.AdoResultSet myRecordset

>

> Chart.Axis(AXIS_Y).Max = 4

>

> Chart.Gallery = BAR

>

> %>

> <%= chart.GetHtmlTag("90%","90%") %>

> </BODY>

> </HTML>

>

>

>

post-2107-13922389549749_thumb.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...