home *** CD-ROM | disk | FTP | other *** search
- <html>
-
- <head>
- <title>RDS 1.5 Query Page</title>
- </head>
-
- <body BACKGROUND="AddressBook/Arcadia.gif">
-
- <h1 align="center">Remote Data Service 1.5 Query Page</h1>
-
- <p align="center"> ProtoView TreeViewX v3.0</p>
-
- <p align="center"><br>
- <OBJECT classid=CLSID:DB625B9A-05EA-11D2-97DD-00400520799C height=180
- id=PVTreeViewX1 style="LEFT: 0px; TOP: 0px" width=200 VIEWASTEXT>
- <PARAM NAME="_Version" VALUE="196608">
- <PARAM NAME="_ExtentX" VALUE="5292">
- <PARAM NAME="_ExtentY" VALUE="4762">
- <PARAM NAME="_StockProps" VALUE="237">
- <PARAM NAME="ForeColor" VALUE="0">
- <PARAM NAME="BackColor" VALUE="16777215">
- <PARAM NAME="BorderStyle" VALUE="0">
- <PARAM NAME="Enabled" VALUE="-1">
- <PARAM NAME="Appearance" VALUE="1">
- <PARAM NAME="SelectMode" VALUE="0">
- <PARAM NAME="HorizontalExtent" VALUE="0">
- <PARAM NAME="MultiColumnStyle" VALUE="0">
- <PARAM NAME="ColumnWidth" VALUE="100">
- <PARAM NAME="NumberOfColumns" VALUE="3">
- <PARAM NAME="Indent" VALUE="18">
- <PARAM NAME="StandardDefaultPicture" VALUE="0">
- <PARAM NAME="Sort" VALUE="0">
- <PARAM NAME="UseTabStops" VALUE="0">
- <PARAM NAME="IntegralHeight" VALUE="-1">
- <PARAM NAME="MultiColumn" VALUE="0">
- <PARAM NAME="EnableMicroBitmaps" VALUE="-1">
- <PARAM NAME="EnableBitmaps" VALUE="-1">
- <PARAM NAME="EnableLines" VALUE="-1">
- <PARAM NAME="AutoOpen" VALUE="0">
- <PARAM NAME="ProportionalScrollBars" VALUE="-1">
- <PARAM NAME="AlwaysShowSelection" VALUE="-1">
- <PARAM NAME="UseStateBitmaps" VALUE="-1">
- <PARAM NAME="AllowInPlaceEditing" VALUE="-1">
- <PARAM NAME="EnableToolTips" VALUE="-1">
- <PARAM NAME="ToolTipBackColor" VALUE="12648447">
- <PARAM NAME="SelectedTextBackColor" VALUE="-2147483635">
- <PARAM NAME="SelectedTextForeColor" VALUE="-2147483634">
- <PARAM NAME="LineColor" VALUE="-2130771968">
- <PARAM NAME="DataMember" VALUE="">
- <PARAM NAME="StandardLevelPicture0" VALUE="-1">
- <PARAM NAME="StandardLevelPicture1" VALUE="-1">
- <PARAM NAME="StandardLevelPicture2" VALUE="-1">
- <PARAM NAME="StandardLevelPicture3" VALUE="-1">
- <PARAM NAME="StandardLevelPicture4" VALUE="-1">
- <PARAM NAME="StandardLevelPicture5" VALUE="-1">
- <PARAM NAME="StandardLevelPicture6" VALUE="-1">
- <PARAM NAME="StandardLevelPicture7" VALUE="-1">
- <PARAM NAME="StandardLevelPicture8" VALUE="-1">
- <PARAM NAME="StandardLevelPicture9" VALUE="-1">
- <PARAM NAME="StandardLevelPicture10" VALUE="-1">
- <PARAM NAME="StandardLevelPicture11" VALUE="-1">
- <PARAM NAME="StandardLevelPicture12" VALUE="-1">
- <PARAM NAME="StandardLevelPicture13" VALUE="-1">
- <PARAM NAME="StandardLevelPicture14" VALUE="-1">
- <PARAM NAME="StandardLevelPicture15" VALUE="-1">
- <PARAM NAME="StandardLevelPicture16" VALUE="-1">
- <PARAM NAME="StandardLevelPicture17" VALUE="-1">
- <PARAM NAME="StandardLevelPicture18" VALUE="-1">
- <PARAM NAME="StandardLevelPicture19" VALUE="-1">
- <PARAM NAME="DataField0" VALUE="ProductName">
- <PARAM NAME="DataField1" VALUE="">
- <PARAM NAME="DataField2" VALUE="">
- <PARAM NAME="DataField3" VALUE="">
- <PARAM NAME="DataField4" VALUE="">
- <PARAM NAME="DataField5" VALUE="">
- <PARAM NAME="DataField6" VALUE="">
- <PARAM NAME="DataField7" VALUE="">
- <PARAM NAME="DataField8" VALUE="">
- <PARAM NAME="DataField9" VALUE="">
- <PARAM NAME="DataField10" VALUE="">
- <PARAM NAME="DataField11" VALUE="">
- <PARAM NAME="DataField12" VALUE="">
- <PARAM NAME="DataField13" VALUE="">
- <PARAM NAME="DataField14" VALUE="">
- <PARAM NAME="DataField15" VALUE="">
- <PARAM NAME="DataField16" VALUE="">
- <PARAM NAME="DataField17" VALUE="">
- <PARAM NAME="DataField18" VALUE="">
- <PARAM NAME="DataField19" VALUE="">
-
- <PARAM NAME="DataSource" DATASRC="#ADC">
- </OBJECT>
-
- </p>
- <div align="center"><center>
-
- <table>
- <tr>
- <td>ADC Server:</td>
- <td><input SIZE="70" NAME="Server"> </td>
- </tr>
- <tr>
- <td>Connection:</td>
- <td><input SIZE="70" NAME="Connect"> </td>
- </tr>
- <tr>
- <td>Query:</td>
- <td><input SIZE="70" NAME="SQL"> </td>
- </tr>
- <tr>
- <td>Recordset Status:</td>
- <td><input SIZE="30" NAME="RecordSetStat" > </td>
- </tr>
- <tr>
- <td>Execute Option:</td>
- <td><input SIZE="30" NAME="ExecOpt" > </td>
- </tr>
- </table>
- </center></div>
-
- <p align="center"><br>
- <input TYPE="button" VALUE="Run!" NAME="Requery">
- <input TYPE="button" VALUE="First" NAME="MoveFirst">
- <input TYPE="button" VALUE="Prev" NAME="MovePrev">
- <input TYPE="button" VALUE="Next" NAME="MoveNext">
- <input TYPE="button" VALUE="Last" NAME="MoveLast">
- <br>
- <br>
- <input TYPE="button" VALUE="Save Changes" NAME="Update">
- <input TYPE="button" VALUE ="Cancel Changes" NAME="Cancel">
- <br>
- <br>
- <input TYPE="button" VALUE="Cancel Query" NAME="Stop">
- <input TYPE="button" VALUE ="Turn Asynch off" NAME="Asynchoff">
- <input TYPE="button" VALUE="Turn Asynch on" NAME="Asynchon">
-
- <OBJECT classid=CLSID:BD96C556-65A3-11D0-983A-00C04FC29E33 height=1 id=ADC
- width=1></OBJECT>
-
- <script LANGUAGE="VBScript">
- '---- enum Values ----
- Const adcExecSync = 1
- Const adcExecAsync = 2
-
- '---- enum Values ----
- Const adcFetchUpFront = 1
- Const adcFetchBackground = 2
- Const adcFetchAsync = 3
-
- '---- enum Values ----
- Const adcStateClosed = &H00000000
- Const adcStateOpen = &H00000001
- Const adcStateConnecting = &H00000002
- Const adcStateExecuting = &H00000004
- Const adcStateFetching = &H00000008
-
- '---- enum Values ----
- Const adcReadyStateUninitialized = 0
- Const adcReadyStateLoading = 1
- Const adcReadyStateLoaded = 2
- Const adcReadyStateInteractive = 3
- Const adcReadyStateComplete = 4
-
-
- SUB Window_OnLoad
- Server.Value = "http://<%=Request.ServerVariables("SERVER_NAME")%>"
- Connect.Value = "DSN=AdvWorks"
- SQL.Value = "Select * from Products"
-
- Select case ADC.ExecuteOptions
- case adcExecSync: ExecOpt.Value = "Synchronous"
- case adcExecAsync: ExecOpt.Value = "Asynchronous"
- END Select
-
- Select case ADC.ReadyState
- case adcReadyStateUninitialized: RecordSetStat.Value = "Unitialized"
- case adcReadyStateLoading: RecordSetStat.Value = "Loading"
- case adcReadyStateLoaded: RecordSetStat.Value = "Loaded"
- case adcReadyStateInteractive: RecordSetStat.Value = "Interactive"
- case adcReadyStateComplete: RecordSetStat.Value = "Complete"
- END Select
-
- END SUB
-
-
- SUB ADC_OnDataSetChanged
- 'Fires after execution is done
-
- Select case ADC.ReadyState
- case adcReadyStateUninitialized: RecordSetStat.Value = "Unitialized"
- case adcReadyStateLoading: RecordSetStat.Value = "Loading"
- case adcReadyStateLoaded: RecordSetStat.Value = "Loaded"
- case adcReadyStateInteractive: RecordSetStat.Value = "Interactive"
- case adcReadyStateComplete: RecordSetStat.Value = "Complete"
- END Select
-
- END SUB
-
- SUB ADC_OnDataSetComplete
- 'Fires after fetching is complete
-
- Select case ADC.ReadyState
- case adcReadyStateUninitialized: RecordSetStat.Value = "Unitialized"
- case adcReadyStateLoading: RecordSetStat.Value = "Loading"
- case adcReadyStateLoaded: RecordSetStat.Value = "Loaded"
- case adcReadyStateInteractive: RecordSetStat.Value = "Interactive"
- case adcReadyStateComplete: RecordSetStat.Value = "Complete"
- END Select
-
- END SUB
-
- sub Move (strDirection)
- 'Custom sub to handle Asyncronous fetching
- 'Asynchronous fetching allows you to cancel in the middle of fetching a large
- 'recordset
- if ADC.Recordset.State = adcStateClosed then
- if ADC.ReadyState = adcReadyStateComplete then
- msgbox "Query results failed to arrive, please rerun query synchronously and check for errors."
- end if
- if ADC.ReadyState = adcReadyStateLoaded then
- msgbox "Query results have not yet arrived"
- end if
- else
- if ADC.Recordset.State = adcStateOpen Then
- on error resume next
- select case strDirection
- Case "First"
- ADC.Recordset.MoveFirst
- Case "Next"
- ADC.Recordset.MoveNext
- Case "Last"
- ADC.Recordset.MoveLast
- Case "Prev"
- ADC.Recordset.MovePrevious
- end select
- IF ERR.Number <> 0 then
- if Err.Number = 3021 THEN
- if ADC.Recordset.BOF then
- ADC.Recordset.MoveFirst 'If already at start of recordset stay at top.
- else
- ADC.Recordset.MoveLast 'If already at end of recordset stay at bottom.
- END IF
- else
- msgbox "Unexpected error in Move actions. " & Err.Description
- END IF
- end if
- else
- msgbox "The state is unexpected, an error has occurred" 'Very General error msg.
- end if
- end if
- End Sub
-
- SUB MoveFirst_OnClick
- 'Call to Custom Sub, Move, to handle attempts to move the record pointer during asynch fetches
- move "First"
- END SUB
-
- SUB MoveNext_OnClick
- 'Call to Custom Sub, Move, to handle attempts to move the record pointer during asynch fetches
- Move "Next"
- END SUB
-
- SUB MovePrev_OnClick
- 'Call to Custom Sub, Move, to handle attempts to move the record pointer during asynch fetches
- Move "Prev"
- END SUB
-
- SUB MoveLast_OnClick
- 'Call to Custom Sub, Move, to handle attempts to move the record pointer during asynch fetches
- Move "Last"
- END SUB
-
- 'Submits edits made and pulls a clean copy of the new data.
- SUB Update_OnClick
- If ADC.ReadyState <> adcReadyStateLoaded then
- ADC.SubmitChanges
- ADC.Refresh
- Else
- MsgBox "Query results still arriving, Please wait"
- End if
-
- END SUB
-
- 'Cancel edits and restores original values.
- SUB Cancel_OnClick
- if ADC.ReadyState <> adcReadyStateLoaded then
- ADC.CancelUpdate
- Else
- MsgBox "Query results still arriving, Please wait"
- End if
-
- END SUB
-
- SUB Requery_OnClick
- If ADC.ReadyState <> adcReadyStateComplete then
- MsgBox "Query results still arriving, Please wait"
- Else
- ADC.Server = Server.Value
- ADC.Connect = Connect.Value
- ADC.SQL = SQL.Value
-
- ADC.Refresh
- End if
-
- END SUB
-
- SUB Stop_OnClick
- 'If an asychronous query is taking too long to execute you can use this to cancel the query
- ADC.Cancel
-
- END SUB
-
- SUB Asynchoff_OnClick
- 'In cases where there are problems querying the database you may need to switch to synchronous mode
- 'in order to get the error
- ADC.ExecuteOptions = adcExecSync
- ADC.FetchOptions = adcFetchBackground
- Select case ADC.ExecuteOptions
- case adcExecSync: ExecOpt.Value = "Synchronous"
- case adcExecAsync: ExecOpt.Value = "Asynchronous"
- END Select
-
-
- END SUB
-
- SUB Asynchon_OnClick
- 'In cases where there are problems querying the database you may need to switch to synchronous mode
- 'in order to get the error
- ADC.ExecuteOptions = adcExecAsync
- ADC.FetchOptions = adcFetchAsync
- Select case ADC.ExecuteOptions
- case adcExecSync: ExecOpt.Value = "Synchronous"
- case adcExecAsync: ExecOpt.Value = "Asynchronous"
- END Select
-
- END SUB
-
- </script>
- </p>
- </body>
- </html>
-