Solved

MSFlexGrid not working

Posted on 2003-11-20
9
1,350 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

803 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