Hi Wrox,
You books are great. Whenever I began to learn something new I always
look to the WROX books first.
From ADO 2.5 RDS Programming with ASP 3.0, I'm trying to get the data
binding code example (pg 407) to work but I get no data.
Environment:
2000 Workstation running IIS 5.0 (Development)
SQL SERVER 7.0 on 2000 Server
The FILE DSN is on the Workstation/Web Server and I've tested the
connection to the "pubs" database. Below is the ASP and the resulting
HTML below that if it helps.
Thanks in advance for any assistance.
J-
Here's my ASP
----------------------------------------------------------------------
<html>
<head>
<!-- RDS Control -->
<object classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
ID="objSControl" WIDTH="1" HEIGHT="1">
<param NAME="SERVER" VALUE="http://<%=Request.ServerVariables
("SERVER_NAME")%>">
</object>
<title>Consultant Listing</title>
</head>
<body language="VBSCRIPT" onload="Load">
<h1 align="center"> </h1>
<CENTER>
<table border="0" cellPadding="1" cellSpacing="1" height="80"
style="HEIGHT: 80px; LEFT: 106px; POSITION: absolute; TOP: 20px; WIDTH:
308px; Z-INDEX: 102" width="48.58%">
<tr>
<td><strong><font size="6">Master Consultants</font></strong>
</td>
</tr>
</table>
<h1 align="center"><font color="#160b5a">
<table border="0" cellPadding="1" cellSpacing="1" height="56"
style="HEIGHT: 56px; LEFT: 23px; POSITION: absolute; TOP: 125px; WIDTH:
223px; Z-INDEX: 103" width="35.17%">
<tr>
<td><strong><font size="4">Consultant Listing</font></strong>
</td>
</tr>
</table>
<br>
</h1>
<h2>
<table border="1" datasrc="#objSControl" style="LEFT: 69px; POSITION:
absolute; TOP: 187px; Z-INDEX: 100">
<tdbody>
<tr>
<td width="50">
<input datafld="au_fName" size="15" id="text0"
name="first">
</td>
<td width="50">
<input datafld="au_lName" size="15" id="text1" name="last">
</td>
<td width="50">
<input datafld="Phone" size="15" id="text2" name="Phone">
</td>
<td width="50">
<input datafld="City" size="15" id="text3" name="City">
</td>
</tr>
</tdbody>
</table>
<script language="VBScript">
'---- enum Values ----
Const adcExecSync = 1
Const adcExecAsync = 2
'---- enum Values ----
Const adcFetchUpFront = 1
Const adcFetchBackground = 2
Const adcFetchAsync = 3
SUB Load
'Change the asynchronous options such that execution is synchronous
'and Fetching can occur in the background
ObjSControl.ExecuteOptions = adcExecSync
ObjSControl.FetchOptions = adcFetchBackground
'Define SQL
ObjSControl.SQL = "Select au_FName, au_LName, Phone, city from
authors"
ObjSControl.Connect = "dsn=pubs;UID=sa;PWD=max4561;"
' System DSN must be installed on this system
ObjSControl.Refresh
END SUB
</script>
<img src="http://adsi/images/logo.gif" style="LEFT: 21px; POSITION:
absolute; TOP: 7px; Z-INDEX: 101" WIDTH="81" HEIGHT="81"></h2></font>
</body>
</html>
-----------------------------------------------------------------------
Resulting HTML
-----------------------------------------------------------------------
<html>
<head>
<!-- RDS Control -->
<object classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
ID="objSControl" WIDTH="1" HEIGHT="1">
<param NAME="SERVER" VALUE="http://john">
</object>
<title>Consultant Listing</title>
</head>
<body language="VBSCRIPT" onload="Load">
<h1 align="center"> </h1>
<CENTER>
<table border="0" cellPadding="1" cellSpacing="1" height="80"
style="HEIGHT: 80px; LEFT: 106px; POSITION: absolute; TOP: 20px; WIDTH:
308px; Z-INDEX: 102" width="48.58%">
<tr>
<td><strong><font size="6">Master Consultants</font></strong>
</td>
</tr>
</table>
<h1 align="center"><font color="#160b5a">
<table border="0" cellPadding="1" cellSpacing="1" height="56"
style="HEIGHT: 56px; LEFT: 23px; POSITION: absolute; TOP: 125px; WIDTH:
223px; Z-INDEX: 103" width="35.17%">
<tr>
<td><strong><font size="4">Consultant Listing</font></strong>
</td>
</tr>
</table>
<br>
</h1>
<h2>
<table border="1" datasrc="#objSControl" style="LEFT: 69px; POSITION:
absolute; TOP: 187px; Z-INDEX: 100">
<tdbody>
<tr>
<td width="50">
<input datafld="au_fName" size="15" id="text0"
name="first">
</td>
<td width="50">
<input datafld="au_lName" size="15" id="text1" name="last">
</td>
<td width="50">
<input datafld="Phone" size="15" id="text2" name="Phone">
</td>
<td width="50">
<input datafld="City" size="15" id="text3" name="City">
</td>
</tr>
</tdbody>
</table>
<script language="VBScript">
'---- enum Values ----
Const adcExecSync = 1
Const adcExecAsync = 2
'---- enum Values ----
Const adcFetchUpFront = 1
Const adcFetchBackground = 2
Const adcFetchAsync = 3
SUB Load
'Change the asynchronous options such that execution is synchronous
'and Fetching can occur in the background
ObjSControl.ExecuteOptions = adcExecSync
ObjSControl.FetchOptions = adcFetchBackground
'Define SQL
ObjSControl.SQL = "Select au_FName, au_LName, Phone, city from
authors"
ObjSControl.Connect = "dsn=pubs;UID=sa;PWD=;"
' System DSN must be installed on this system
ObjSControl.Refresh
END SUB
</script>
<img src="http://adsi/images/logo.gif" style="LEFT: 21px; POSITION:
absolute; TOP: 7px; Z-INDEX: 101" WIDTH="81" HEIGHT="81"></h2></font>
</body>
</html>