Link to home
Start Free TrialLog in
Avatar of cube
cube

asked on

Data Grid/Control


I'm having trouble getting the Microsoft Data Control and Microsoft Data Grid to work in FrontPage the way I'm used to them working in VB6.

I created a new page in FrontPage.  Added one of each of the above mentioned controls.  I used to the ConnectString, CommandType, and RecordSource parameters on the Data Control to point to a stored procedure in an Microsoft SQl Server 7.0 database.

Then I added the DataSource parameter to the Data Grid, because it wasn't in the default list,  and made it's value the name of the data control.

However when I go to preview it both controls are grayed out with no data.  Any suggestions???
Avatar of ClassyLinks
ClassyLinks
Flag of Canada image

This MAY be one of those features that doesn't work in preview mode....have you tried looking at it from a web server??
Avatar of cube
cube

ASKER

Yes, I have tried it using Microsoft Internet Explorer 5.5.  It does not work their either.  

A bit more background:  I started this whole process taking a Visual Basic program and converting it to an ActiveX compenent for Internet Distribution.  I got that all working and wanted to cut the Visual Basic piece out and just have a straight web page.  

I know I can't be far  from getting this working, but I don't understand what I'm doing wrong yet.
Avatar of cube

ASKER

If it helps, here's the HTML that FrontPage generated:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>

<p>
<object classid="clsid:67397AA3-7FB1-11D0-B148-00A0C922E820" id="Adodc1" width="100" height="50">
  <param name="_ExtentX" value="2646">
  <param name="_ExtentY" value="1323">
  <param name="ConnectMode" value="0">
  <param name="CursorLocation" value="3">
  <param name="IsolationLevel" value="-1">
  <param name="ConnectionTimeout" value="15">
  <param name="CommandTimeout" value="30">
  <param name="CursorType" value="3">
  <param name="LockType" value="3">
  <param name="CommandType" value="4">
  <param name="CursorOptions" value="0">
  <param name="CacheSize" value="50">
  <param name="MaxRecords" value="0">
  <param name="BOFAction" value="0">
  <param name="EOFAction" value="0">
  <param name="ConnectStringType" value="1">
  <param name="Appearance" value="1">
  <param name="BackColor" value="-2147483643">
  <param name="ForeColor" value="-2147483640">
  <param name="Orientation" value="0">
  <param name="Enabled" value="-1">
  <param name="Connect" value="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=abrown;Initial Catalog=PDIS;Data Source=Server70;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False">
  <param name="OLEDBString" value="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=abrown;Initial Catalog=PDIS;Data Source=Server70;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False">
  <param name="OLEDBFile" value>
  <param name="DataSourceName" value>
  <param name="OtherAttributes" value>
  <param name="UserName" value>
  <param name="Password" value>
  <param name="RecordSource" value="vb_GetSigList;1">
  <param name="Caption" value="Adodc1">
  <param name="_Version" value="393216">
</object>
</p>
<p>
<object classid="clsid:CDE57A43-8B86-11D0-B3C6-00A0C90AEA82" id="DataGrid1" width="100" height="50">
  <param name="_ExtentX" value="2646">
  <param name="_ExtentY" value="1323">
  <param name="_Version" value="393216">
  <param name="AllowUpdate" value="255">
  <param name="AllowArrows" value="255">
  <param name="Appearance" value="1">
  <param name="BackColor" value="2147483653">
  <param name="BorderStyle" value="1">
  <param name="DefColWidth" value="0">
  <param name="Enabled" value="255">
  <param name="ColumnHeaders" value="255">
  <param name="ForeColor" value="2147483656">
  <param name="HeadLines" value="1">
  <param name="RowHeight" value="15">
  <param name="TabAcrossSplits" value="0">
  <param name="TabAction" value="0">
  <param name="WrapCellPointer" value="0">
  <param name="RowDividerStyle" value="2">
  <param name="FormatLocked" value="0">
  <param name="AllowAddNew" value="0">
  <param name="AllowDelete" value="0">
  <param name="RightToLeft" value="0">
  <param name="DataMember" value>
  <param name="Caption" value>
  <param name="ColumnCount" value="2">
  <param name="SplitCount" value="1">
  <param name="DataSource" value="ADOdc1">
</object>
</p>

</body>

</html>
I'm afraid I'm not much of an ActiveX genius....how about we get some VB people in here to help out??
Avatar of hes
Ok first off it is not you it is IE's security. Those controls are licensed for vb but IE does not recognise that.

I had the same problem when I first tried to use a msflexgrid in html.
Try the following:

VB activeX controls are licensed for the development box only. IE's license manager will not display
a unlicensed control. You have to create a .LPK file from the tool
lpk_tool.exe located on the vb install cd under common/tools/vb/lpk, then install that file on the server
running the htmp page and add the following code to the html page
<object CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"   width="50" height="50">
   <param name="LPKPath" value="FileName.lpk">
 </object>


FileName.lpk is the path and name of the lpk file you created, path relative to where the html page
is stored.

Hi hes...thanks for stopping by!

Wow is that ever over my head!  I have no idea what you are talking about.  I hope cube is better off than I am.
ASKER CERTIFIED SOLUTION
Avatar of hes
hes
Flag of United States of America 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 think you need a sort of vbscript on your web page to manage properties and events of those controls.
Avatar of cube

ASKER

I am familiar with the LPK_TOOL, and used it for the VB version of this project.  I don't think that's my problem here, because when I open the HTML page in IE, the objects are visible, just grayed out.  I thought if it was a license issue, IE didn't even show the object.

But, just to be sure I tried it.  I created a license file containing the Microsoft ADO Data Control and the Microsoft Data Grid Control.  Then I added the following lines to the HTML I posted above:

<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
     <PARAM NAME="LPKPath" VALUE="new_page_1.LPK">
</OBJECT>

There was no difference in the behavior.  It's days like this that make me want to go flip burgers - heck, I probably couldn't even figure out to do that on a day like this.


Where is the SQL database you're trying to connect to?  It would have to be on the client computer for your code to work, it seems to me.

I have never tried embedding an ADODC in a web page, is this a control that should work in this environment?
No luck cube??
I didn't get into this, deeply, so just my 0.02:
+ Both objects are signed to be safe for scripting, for whatever reason.
+ For me (VB installed), they were not grayed out.
+ For me, the database connection didn't work but I didn't try to get into that.
+ For whatever reason, on the web, mostly the Sheridan grid is used (a demo version even ships with the MS ADODB SDK samples), although it's not free.
cube...can you come back and tell us if any of this has helped, or if you are any further ahead???

Thanks
Avatar of cube

ASKER


Sorry for my silence, but I've been out of the office for a week and a half.  
I have resolved the original issue.  I switched over to Microsoft InterDev to see if I could get better results out of it.  The following code works just fine in InterDev:

<HTML>
<BODY>

<!-- ADO Data Control -->
<OBJECT ID = "ADODC"
CLASSID = "clsid:67397AA3-7FB1-11D0-B148-00A0C922E820"
WIDTH = 400
HEIGHT = 10
>
</OBJECT>

<OBJECT CLASSID="clsid:CDE57A43-8B86-11D0-B3C6-00A0C90AEA82" id=DataGrid1
WIDTH = 400
HEIGHT = 300
>
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--

SUB Window_OnLoad()
     ADODC.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=abrown;Initial Catalog=PDIS;Data Source=Server70;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=EN1964J;Use Encryption for Data=False;Tag with column collation when possible=False"
     ADODC.CommandType = 4
     ADODC.RecordSource = "vb_getsiglist;1"
     Set DataGrid1.DataSource = ADODC
     ADODC.Refresh
END SUB

-->
</SCRIPT>
</BODY>
</HTML>

Actually, it works just fine when viewed using the InterDev preview feature.  When I save it and take it to a test machine, the ADO Data Control chokes and says it doesn't have the a ConnectionString property.  

So I just need to get past that & I'm off to the races.

Thanks for all the help!
Avatar of cube

ASKER

While this answer didn't directly solve my problem, it prompted me to switch over to broaden my search for a solution.
Try using this for your recordset

' Datagrid1 is the id of the Datagrid control
' ADODC is the id of the ADO Data Control
Set Datagrid1.DataSource = ADODC.Recordset