[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 477
  • Last Modified:

Working in InterDev problem with RecordSet

Code listed below works till I attempt to bring in a record set,  I have no idea what is wrong.  This is my first attempt developing in InterDev.  Any ideas and help would be great.  I need the recordset to come in and populate a bubble chart.

<Script Language=VBScript RUNAT=Server>
 '  DTCSetSession sets how the system handles delection of files.
    'Const ktKillFile = False
    'Const ktSession = True
    Const ktTIME = 2
      If Not IsObject(TimeGraph) Then
            Set TimeGraph = Server.CreateObject("GSServer.GSServerProp")
      End If
'    an Expiration for this HTML file on the User's end
      'Response.Expires = 0
'      By setting the session to ktPUSH, we are indicating that the
'      file delection will be handled by the GSServerImage class in conjuction
'      with the Image.ASP file.  The number in the 4th parameter of the
'      SendImage() function is passed directly to the Response.Expires setting
'      for the image.    
      TimeGraph.DTCSetSession = ktTime            'Valid setting of 0, 1, 2
      TimeGraph.URL = "Images/"
      TimeGraph.Path = Server.MapPath(TimeGraph.URL)

      i = 1
      While Not rstTime.EOF
            i = i+1
    With TimeGraph
      .NumSets = 2                          'Required
      .NumPoints = i                                    'Number of Bubbles desired 'Number of records
      .graphType = 12                       'Bubble graph
      For i = 1 To .NumPoints
         .ThisSet = 1
         .Data(i) = rstTime(AvgUnits)       'Diameter 'CDbl(rs("NumberOfContracts").Value)
         .XPos(i) = rstTime(AvgTime)            'X Position 'CDbl(rs("BuildAmount").Value)
         .ThisSet = 2
         .XPos(i) = rstTime(AvgROI)                  'Y Position 'CDbl(rs("NumberOfUnits").Value)
         .Color(i) = i
         .Legend(i) = CStrrstTime(TimePeriod)
      .NewLineChar = 126                              'Set the line return so graph can have you line labels
      .Background = 15                                    'Set the Background color to White
      .Palette = 9                                          'Set the Color Palette for the Bubble to default
      '.SDKPaint = 1
      '.DrawMode = 3
      .Output = ".PNG"  'Determines type of image fie outputted
      .Height = 300
      .Width = 300
      TimeGraph_Filename = .DrawGraph() 'Returns a randomly generated filename
        .MapFormat = 0
        TimeGraph_Width = TimeGraph.Width
        TimeGraph_Height = TimeGraph.Height
        TimeGraph.TraceClass = True
        TimeGraph_File = TimeGraph.DrawGraph()
        TimeGraph.TraceClass = False
        TimeGraph_Ext = TimeGraph.Output
        If TimeGraph.MapFormat = 0 then
            TimeGraph_Map = TimeGraph.GetMap(Server.MapPath(TimeGraph_File + ".map"))
        End If

   End With


<!--METADATA TYPE="DesignerControl" startspan
<OBJECT classid="clsid:9CF5D7C2-EC10-11D0-9862-0000F8027CA0" id=rstTime style="LEFT: 0px; TOP: 0px">
      <PARAM NAME="ExtentX" VALUE="12197">
      <PARAM NAME="ExtentY" VALUE="2090">
      <PARAM NAME="State" VALUE="(TCConn=\qcnnTime\q,TCDBObject=\qDE\sCommands\q,TCDBObjectName=\qTime\q,TCControlID_Unmatched=\qrstTime\q,TCPPConn=\qcnnTime\q,RCDBObject=\qRCDBObject\q,TCPPDBObject=\qDE\sCommands\q,TCPPDBObjectName=\qTime\q,TCCursorType=\q3\s-\sStatic\q,TCCursorLocation=\q3\s-\sUse\sclient-side\scursors\q,TCLockType=\q3\s-\sOptimistic\q,TCCacheSize_Unmatched=\q100\q,TCCommTimeout_Unmatched=\q30\q,CCPrepared=0,CCAllRecords=1,TCNRecords_Unmatched=\q10\q,TCODBCSyntax_Unmatched=\q\q,TCHTargetPlatform=\q\q,TCHTargetBrowser_Unmatched=\qServer\s(ASP)\q,TCTargetPlatform=\qInherit\sfrom\spage\q,RCCache=\qRCBookPage\q,CCOpen=1,GCParameters=(Rows=0))"></OBJECT>
<!--#INCLUDE FILE="_ScriptLibrary/Recordset.ASP"-->
<SCRIPT LANGUAGE="JavaScript" RUNAT="server">
function _initrstTime()
      var rsTmp = DE.Recordsets('Time');
      if (thisPage.getState('pb_rstTime') != null)
function _rstTime_ctor()
      CreateRecordset('rstTime', _initrstTime, null);
function _rstTime_dtor()
      thisPage.setState('pb_rstTime', rstTime.getBookmark());

<!--METADATA TYPE="DesignerControl" endspan-->

      <img src="Image.asp?Image=<% = TimeGraph_File + TimeGraph_Ext%>" border="0" width="<% = TimeGraph_Width %>" height="<% = TimeGraph_Height %>"></a><br>

1 Solution
Where does the error occur?

Hopefully not in _ScriptLibrary/RECORDSET.ASP - as always, line 476?
where does rstTime come from.  I dont see it initialized or loaded???
akeyesAuthor Commented:
To Robert:
Line 20 just as I start to use the Data.

To jamestthomas:
I am using a DE Connection thur the InterDev program.  Since this is my first program with InterDev that may not be the right.

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

to get the recordset:

dim cn
dim rsTime
dim rsString

set cn = createobject("ADODB.Connection")
cn.open "dsn=<your dsn>"

set rsObj = createobject("ADODB.Recordset")
rsString = "Select * from <tablename>"
rsTime.open rsString, cn

now you have the rsTime to work with.

don't forget to add this att the end

set rsTime = nothing
set rscn = nothing
The "answer" is the basic thing everyone does all the time.  That's why i was asking where you loaded the recordset.  I would keep the question open to get some feedback on what you were trying to do with the DE connection. Otherwise, get a book on ASP, WROX has some good ones or go online and do some research. Good luck.
Make sure you've enabled scripting object model, by the way how did you create the DE Connection? I hope you had understood how to create such a data command in Interdev.

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now