Link to home
Start Free TrialLog in
Avatar of mdberk3
mdberk3

asked on

MSFlexGrid not working

Hello,
I've written an ASP webpage with an MSFlexGrid on it.
The website run on an IIS5 server (Windows2000)
Both the IIS server and my development workstation have Visual Studio 6 loaded and the webpage runs just fine. However, when I access the page from a machine with Visual Studio on it, I get a page error. The error states 'Object or property not supported: MSFlexGrid1.Redraw
I've remarked out the line and the next FlexGrid statement errors the same way except on a different property. Example: 'Object or property not supported: MSFlexGrid1.FormatString
I'm using client-side VBscript to manipulate the grid. Example:
<SCRIPT LANGUAGE=vbscript>msflexgrid1.redraw</script>
The OCX appears to be in the Winnt\system32 folder and appears in the registry.
Also if I look in the Internet Setup of Internet Explorer on the client, I click the View Object button and see the control in the objects list. I've set all ActiveX security setting to PROMPT. I initially got the popup to download and install the control based on the CODEBASE line in the object tag. I have tried unregistering/re-registering the control several times. Any help would be greatly appreciated.

-mark
Avatar of Sethi
Sethi
Flag of India image

Please post your code.
Avatar of mdberk3
mdberk3

ASKER

Very simple.
First, I have a client side vbscript that calls a server side sub

<SCRIPT language=vbscript>
sub  window_onload
       <%FillCells%>
end sub
</SCRIPT>

this works fine

Then the server code to fill in grid starts like this but barks on very first line

<%
sub FillCells
      msflexgrid.FormatString = "Field1   | Field2   | Field3  "
end sub
%>

Nothing fancy really. I can't get past first line of code that references the grid.
I immediately get Property or method not supprted: msflexgrid.FormatString

My next line is msflexgrid.rows = 100
If I remark out the FormatString line, the error moves to next line msflexgrid.rows = 100

I have a feeling this has something to do with the control not registered properly or some vb runtime missing. But can't seem to nail it down. I even created a simple VB app that had the control in it. Loaded on the client. The VB app displayed the grid just fine. Its only when I use the control with ASP in IE that I get error.

Please help.

-mark

Difficult to know without the full code.
Avatar of mdberk3

ASKER

The problem is definetly not the ASP code but will attach anyway. The code works fine on 4 other machines that have either Visual Basic or Visual Studio loaded. It has something to do with the OCX file not registering or being registerd incorrectly. Maybe has something to do with missing VB runtimes? I have the same exact problem with the DTPicker control on a different page which confirms my thought that is has to do with the control. Here is the block of code that is generating the error. The first Response.Write line in the FillCells sub is the one generating the error "Property or Method not supported: MSFlexGrid1.Rows
I've never used the Flexgrid or any ActiveX control on an ASP page in the past and can't find any documentation on the exact procedure to deploy the Flexgrid control. The only thing I was able to find was to add the codebase statement to the object tag that point to MS website for download and install.

Thnks for any help you can provide.

 <%@ LANGUAGE="VBSCRIPT" %>

   <HTML>
   <HEAD>
   <META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
   <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
   <TITLE>Document Title</TITLE>

<%
Dim conn,rs,SQL
set conn = server.CreateObject("ADODB.Connection")
set rs = server.CreateObject("ADODB.Recordset")

'DSN less connection
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.ConnectionString = "Data Source=" & server.mappath("PeproTech.mdb")
conn.open
rs.Open "SELECT * FROM Product_Catalog ORDER BY Product_Catalog.CatalogNum", conn, , , adOpenKeyset

a = 0
do until rs.eof
a = a + 1
rs.movenext
loop
rs.movefirst
%>


   <!--METADATA TYPE="DesignerControl" endspan-->
   <%
      Sub FillCells
         Dim ctRow, ctCol, vbCrLF
         vbCrLf= Chr(13) & Chr(10)
         ctCol=0
         ' Note: added 1 to rows so that we can print field headings
         Response.Write "MSFlexGrid1.Rows=" & a+1 & vbCrLf
         Response.Write "MSFlexGrid1.Cols=" & rs.Fields.Count & vbCrLf
            
         ' Print field headings
              Response.Write "MSFlexGrid1.Row=0" & vbCrLf

         For Each fld in rs.Fields
            Response.Write "MSFlexGrid1.Col=" & ctCol & vbCrLf
          Response.Write "MSFlexGrid1.Text=" & Chr(34) & Trim(fld.Name) & Chr(34) & vbCrLf
            ctCol=ctCol+1
         Next

         ' Print data
         ctRow=1
         Do Until rs.eof
            Response.Write "MSFlexGrid1.Row=" & ctRow & vbCrLf
            ctCol=0
            For Each fld in rs.Fields
               Response.Write "MSFlexGrid1.Col=" & ctCol & vbCrLf
               Response.Write "MSFlexGrid1.Text=" & Chr(34) & Trim(fld) & Chr(34) & vbCrLf
               ctCol=ctCol+1
            Next

            rs.MoveNext
            ctRow=ctRow+1
         Loop
      End Sub
   %>

      <SCRIPT LANGUAGE="VBScript">
      <!--
      Sub window_onLoad()
         <%FillCells%>
      End Sub

      -->
      </SCRIPT>


   </HEAD>
   <BODY>

   <OBJECT ID="MSFlexGrid1" WIDTH=668 HEIGHT=156
    CLASSID="CLSID:6262D3A0-531B-11CF-91F6-C2863C385E30" codebase=http://activex.microsoft.com/controls/vb6/msflxgrd.cab>
      <PARAM NAME="_ExtentX" VALUE="17674">
      <PARAM NAME="_ExtentY" VALUE="4128">
      <PARAM NAME="_Version" VALUE="65541">
      <PARAM NAME="Rows" VALUE="2">
      <PARAM NAME="Cols" VALUE="1">
      <PARAM NAME="FixedRows" VALUE="1">
      <PARAM NAME="FixedCols" VALUE="0">
      <PARAM NAME="AllowUserResizing" VALUE="1">
   </OBJECT>

   </BODY>
   </HTML>
ASKER CERTIFIED SOLUTION
Avatar of Sethi
Sethi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I answered the question.