Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 2nd, 2004, 02:11 AM
Registered User
 
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default RDS problem with the code

I have used the following code for the binding of the data with the TextBoxes on the form.
But when i click the button for the data mvement, an error is displayed that the recordset is closed.
the code used is as follows

<html>

<head>
<title>test programme</title>
</head>

<body bgcolor="ffffff" text="000000" Link="000080" language="VBS" OnLoad="Init">

<p>
<object id="ADC" WIDTH="1" HEIGHT="1" classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33">
</object>
</p>

<h1 align="center">MV LOAD DATA EDIT </h1>

<p ALIGN="CENTER"><br>
<br>
</p>
<div align="center"><center">


<table border="0" cellpadding="5" cellspacing="0" width="100%" height="613">
<tr>
    <td width="8%" valign="middle" align="center" height="32"><strong>1.</strong></td>
    <td width="20%" height="32"><strong>LOAD NO.</strong></td>
    <td><input TYPE="text" SIZE="5" ID="LD_NO" NAME="LD_NO" datasrc="#ADC" datafld="LD_NO"> </td>
    <td width="8%" valign="middle" align="center" height="32"><strong>2.</strong></td>
    <td width="20%" height="32"><strong>BOARD NO.</strong></td>
    <td width="22.5%" height="32"><input SIZE="6" ID="BD_NO" NAME="BD_N0" maxlength="15"
    tabindex="1" datasrc="#ADC" datafld="BD_NO"> </td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="43"><strong>3.</strong></td>
    <td width="20%" height="43"><strong>LOAD TITLE
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp; :</strong></td>
    <td width="22.5%" height="43"><input SIZE="6" ID="LD_TITLE" NAME="LD_TITLE" datasrc="#ADC"
    datafld="LD_TITLE"> </td>
    <td width="8%" valign="middle" align="center" height="32"><strong>4.</strong></td>
    <td width="20%" height="32"><strong>UNIT/STATION</strong></td>
    <td width="22.5%" height="32"><input TYPE="text" SIZE="5" ID="UNIT" NAME="UNIT"
    datasrc="#ADC" datafld="UNIT"> </td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="43"><strong>5.</strong></td>
    <td width="20%" height="43"><strong>NAME PLATE RATING</strong></td>
    <td width="22.5%" height="43"><input SIZE="6" ID="N-PLATE_RATING" NAME="N_PLATE_RATING"
    tabindex="4" maxlength="10" datasrc="#ADC" datafld="N_PLATE_RATING"> </td>
    <td width="8%" valign="middle" align="center" height="32"><strong>6.</strong></td>
    <td width="20%" height="32"><strong>MAX. CONT RATING</strong></td>
    <td width="22.5%" height="32"><input SIZE="6" ID="MAX_RATING" NAME="MAX_RATING"
    tabindex="5" maxlength="10" datasrc="#ADC" datafld="MAX_RATING"> </td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="32"><strong>7.</strong></td>
    <td width="20%" height="32"><strong>NO OF MAIN DRIVES</strong></td>
    <td width="22.5%" height="32"><input SIZE="1" ID="MAIN_NO" NAME="MAIN_NO" tabindex="6"
    maxlength="2" datasrc="#ADC" datafld="MAINNO"> </td>
    <td width="8%" valign="middle" align="center" height="32"><strong>8.</strong></td>
    <td width="20%" height="32"><strong>NO.OF STANDBY DRIVES</strong></td>
    <td width="22.5%" height="32"><input SIZE="1" ID="STANDBY_NO" NAME="STANDBY_DRIVE"
    tabindex="7" maxlength="2" datasrc="#ADC" datafld="STANDBY_NO"> </td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="32"><strong>9.</strong></td>
    <td width="20%" height="32"><strong>VOLTAGE CODE</strong></td>
    <td width="22.5%" height="32"><input TYPE="text" SIZE="10" ID="VOLT" NAME="volt"
    datasrc="#ADC" datafld="VOLT"> </td>
    <td width="8%" valign="middle" align="center" height="32"><strong>10.</strong></td>
    <td width="20%" height="32"><strong>EMERGENCY LOAD</strong></td>
    <td width="22.5%" height="32"><input TYPE="text" SIZE="3" ID="LD_EMERG" NAME="LD_EMERG"
    datasrc="#ADC" datafld="LD_EMERG"> </td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="32"><strong>11.</strong></td>
    <td width="20%" height="32"><strong>DRIVE INERTIA</strong></td>
    <td width="22.5%" height="32"><input TYPE="text" SIZE="10" ID="INERTIA" NAME="INERTIA"
    datasrc="#ADC" datafld="INERTIA"> </td>
    <td width="8%" valign="middle" align="center" height="32"><strong>12.</strong></td>
    <td width="20%" height="32"><strong>SI NUMBER</strong></td>
    <td width="22.5%" height="32"><input SIZE="5" ID="SI_NO" NAME="SI_NO" maxlength="15"
    tabindex="11" datasrc="#ADC" datafld="SI_NO"> </td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="32"><strong>13.</strong></td>
    <td width="20%" height="32" valign="middle" align="left"><strong>SOURCE
    AGENCY&nbsp; </strong></td>
    <td width="22.5%" height="32"><input TYPE="text" SIZE="10" ID="SOURCE" NAME="SOURCE"
    datasrc="#ADC" datafld="SOURCE"> </td>
    <td width="8%" valign="middle" align="center" height="32"><strong>14.</strong></td>
    <td width="20%" height="32" bordercolor="#00FFFF"><strong>STATUS</strong></td>
    <td width="22.5%" height="32"><input TYPE="text" SIZE="3" ID="STATUS" NAME="STATUS"
    datasrc="#ADC" datafld="STATUS"> </td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="32"><strong>15.</strong></td>
    <td width="20%" height="32"><strong>PLANT CODE</strong></td>
    <td width="22.5%" height="32"><input SIZE="18" ID="P_CODE" NAME="P_CODE" maxlength="10"
    tabindex="14" datasrc="#ADC" datafld="P_CODE"> </td>
    <td width="8%" valign="middle" align="center" height="32"><strong>16.</strong></td>
    <td width="20%" height="32"><strong>FEEDER TYPE CODE.</strong></td>
    <td width="22.5%" height="32">&nbsp; <input TYPE="text" SIZE="10" ID="FDR_TYPE"
    NAME="FDR_TYPE" datasrc="#ADC" datafld="FDR_TYPE"> </td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="63"><strong>17.</strong></td>
    <td width="20%" height="63"><strong>FEEDER PROTECTION</strong></td>
    <td width="22.5%" height="63"><input TYPE="text" SIZE="3" ID="PROT_TYPE" NAME="PROT_TYPE"
    datasrc="#ADC" datafld="PROT_TYPE"> </td>
    <td width="8%" valign="middle" align="center" height="63"><strong>18.</strong></td>
    <td width="20%" height="63"><strong>PROTECTION TIME </strong></td>
    <td width="22.5%" height="63"><input TYPE="text" SIZE="5" ID="PROT_TIME" NAME="PROT_TIME"
    datasrc="#ADC" datafld="PROT_TIME"> </td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="28"><strong>19.</strong></td>
    <td width="20%" height="28"><strong>BLOCK CABLE NO.</strong></td>
    <td width="22.5%" height="28"><input SIZE="5" ID="CBL_BLOCK" NAME="CBL_BLOCK"
    tabindex="18" maxlength="15" datasrc="#ADC" datafld="CBL_BLOCK"> </td>
    <td width="8%" valign="middle" align="center" height="32"><strong>20.</strong></td>
    <td width="20%" height="32"><strong>CABLE SIZE CODE</strong></td>
    <td width="22.5%" height="32"><input SIZE="10" ID="CBL_SIZE" NAME="CBL_SIZE"
    maxlength="15" tabindex="19" datasrc="#ADC" datafld="CBL_SIZE"> </td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="32"><strong>21.</strong></td>
    <td width="20%" height="32"><strong>CONTROL CODE</strong></td>
    <td width="22.5%" height="32"><input SIZE="10" ID="CTL_CODE" NAME="CTL_CODE"
    maxlength="15" tabindex="20" datasrc="#ADC" datafld="CTLCODE"> </td>
    <td width="8%" valign="middle" align="center" height="43"></td>
    <td width="20%" height="43"></td>
    <td width="22.5%" height="43"></td>
</tr>
<tr>
    <td width="8%" valign="middle" align="center" height="81"><strong>22.</strong></td>
    <td width="20%" height="81"><strong>LOAD LOCATION
    AREA/ELEV/COL NO.</strong></td>
    <td width="22.5%" height="81"><input SIZE="20" ID="LD_LOCAT" NAME="LD_LOCAT" tabindex="21"
    datasrc="#ADC" datafld="LD_LOCAT"> </td>
    <td width="8%" valign="middle" align="center" height="42"><strong>23.</strong></td>
    <td width="20%" height="42"><strong>BOARD LOCATION
    AREA/ELEV/COL NO.</strong></td>
    <td width="22.5%" height="42"><input SIZE="20" ID="BD_LOCAT" NAME="BD_LOCAT" tabindex="21"
    datasrc="#ADC" datafld="BD_LOCAT"> </td>
</tr>
<tr>
    <td width="28%" valign="middle" align="center" height="31" colspan="2"><strong><small>DATA
    TO BE MAILED TO
    </strong></small><p><strong><small>(Please Enter E_mail
    Address)
    </small></strong></td>
    <td width="22.5%" height="31"><input TYPE="text" SIZE="25" ID="EMAIL" NAME="EMAIL"
    tabindex="23" datasrc="#ADC" datafld="EMAIL"> </td>
    <td width="8%" valign="middle" align="center" height="31"></td>
    <td width="20%" height="31"><strong>DATE &amp; TIME </strong></td>
    <td width="22.5%" height="31"><input TYPE="text" SIZE="15" ID="DATE" NAME="DATE"
    tabindex="24" VALUE="<%=now()%>"> </td>
</tr>
<tr>
    <td width="28%" valign="middle" align="center" height="31" colspan="2"></td>
    <td width="22.5%" height="31"></td>
    <td width="8%" valign="middle" align="center" height="31"></td>
    <td width="20%" height="31"></td>
    <td width="22.5%" height="31"></td>
</tr>
</table>
</div>

<p><input type="BUTTON" Name="First" value="First" OnClick="MoveFirst"> <input
type="BUTTON" Name="Prev" value="Prev" OnClick="MovePrev"> <input type="BUTTON"
Name="Next" value="Next" OnClick="MoveNext"> <input type="BUTTON" Name="Last" value="Last"
OnClick="MoveLast"><br>
<br>
<input type="BUTTON" Name="Update" value="Refresh" OnClick="Refresh"> <input type="BUTTON"
Name="Update" value="Save Changes" OnClick="Update"> <input type="BUTTON" Name="Cancel"
value="Cancel Change" OnClick="cancel"> </p>

<p>SQL UPDATE:<br>
<input TYPE="TEXT" NAME="SQL" SIZE="100"></p>
<script language="VBScript" OnLoad="Init"><!--
sub MoveFirst
ADC.Recordset.MovePrevious
end sub

sub MoveNext
on Error Resume Next
ADC.Recordset.MoveNext
If Err.Number <> 0 then
ADC.Recordset.movelast
End If
End sub

Sub MovePrev
on Error Resume Next
ADC.Recordset.MovePrevious
If Err.Number <> 0 then
ADC.Recordset.MoveFirst
End If
End sub

sub MoveLast
ADC.Recordset.MoveLast
end sub

sub Update
ADC.SubmitChanges
End Sub

Sub cancel
ADC.CancelUpdate
End Sub

Sub Requery
ADC.Server="http://qly-152-skb"
ADC.CONNECT= "DSN=sad1;uid=sa "
ADC.SQL= "SELECT * FROM mv_load_data "
ADC.Refresh
End SUB

Sub Init
msgbox "it is entering"
ADC.Server="http://qly-152-skb"
ADC.CONNECT= "DSN=sad1;uid=sa "
ADC.SQL= "SELECT * FROM mv_load_data "
ADC.Refresh
End SUB
--></script>

</body>
</html>

the data is on the server and the ecordset is getting closed on error
can some body help me to find out the cause
regards
Reply With Quote
  #2 (permalink)  
Old November 4th, 2004, 06:51 AM
Sri Sri is offline
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Bansal,

  I may not help -- bcoz i am brand new to RDS..Below is my query ..

  I am using Remote data Service (RDS) for connecting my MSAccess database which in web.When ever i try do connect my database its show
"Internet Server Error" - why is it so?

Another thing ,
i) is MICROSOFT still supports RDS since its outdated one?
ii) wats are the basic requirement to connect like do we require a Web server..etc

Please help me..its urgent


my code goes this way..

Set rdc = New RDS.DataControl
rdc.Server = "http://myserver/"
rdc.SQL = "select * from Author"
rdc.ExecuteOptions = adcExecAsync

rdc.Connect = "Provider=sqloledb;" & _
                     "Data Source=http://myserver/db/Nwind.mdb;" & _
                     "User Id=username;" & _
                     "Password=password"


rdc.Refresh

While rdc.ReadyState = adcReadyStateLoaded
  DoEvents
Wend
'MsgBox rdc.Recordset
'Do Until rdc.Recordset.EOF
  With rdc.Recordset
      List1.AddItem .Fields("Author")
     .MoveNext
  End With



God’s ways are more than man’s arithmetic - The Mahatma
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help understanding the status of RDS calgarychinese Classic ASP Databases 0 July 28th, 2008 06:51 PM
Problem with DHTML and RDS Kurt.W HTML Code Clinic 4 September 29th, 2005 08:11 PM
Access Database from Javascript with rds nosreg Access 2 February 3rd, 2005 07:19 PM
Facing problems using RDS in VB - Urgent Sri VB Components 0 November 4th, 2004 06:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.