Solved

MSFlexGrid not working

Posted on 2003-11-20
9
1,343 Views
Last Modified: 2013-12-26
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
0
Comment
Question by:mdberk3
  • 4
  • 2
9 Comments
 
LVL 18

Expert Comment

by:Sethi
ID: 9804744
Please post your code.
0
 

Author Comment

by:mdberk3
ID: 9804853
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

0
 
LVL 18

Expert Comment

by:Sethi
ID: 9805861
Difficult to know without the full code.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:mdberk3
ID: 9806238
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>
0
 
LVL 18

Accepted Solution

by:
Sethi earned 250 total points
ID: 9807867
MSflexgrid is dependent upon "ComCat.dll". This is one of the six basic VB runtime files that are required to run a VB application. So ensure that VB runtime 6 is installed on the machine where you are running this application or at least this dll is registered.
0
 
LVL 18

Expert Comment

by:Sethi
ID: 10483179
I answered the question.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now