?? mdmthrefreshvbs.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML dir=ltr>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=gb2312"><title>Refresh 方法范例 (VBScript)</title>
<style>@import url(msdn_ie4.css);</style>
</HEAD>
<BODY>
<h3><a name="mdmthrefreshvbs"></a>Refresh 方法范例 (VBScript)</h3>
<p>
以下范例舉例說明如何在運行時設置必要的 <b>RDS.DataControl</b> 參數。使用 <b>Refresh</b> 方法檢索 <b>Recordset</b> 的方式取決于 <b>ExecuteOptions</b> 和 <b>FetchOptions</b> 屬性的設置。如要測試該范例,請剪切該代碼并粘貼至規范的 HTML 文本的 <Body></Body> 標記之間,并將其命名為“ADCapi2.asp”。ASP 腳本將標識服務器。</p>
<pre><HTML>
<HEAD>
<TITLE>Refresh / ExecuteOptions</TITLE>
</HEAD>
<BODY>
<Center><H2>RDS API Code Examples </H2>
<HR>
<Object CLASSID="clsid:AC05DC80-7DF1-11d0-839E-00A024A94B3A"
CODEBASE="http://<%=Request.ServerVariables("SERVER_NAME")%>/MSADC/Samples/Sheridan.cab"
ID=GRID1
datasrc=#ADC
HEIGHT=125
WIDTH=495>
<PARAM NAME="AllowAddNew" VALUE="TRUE">
<PARAM NAME="AllowDelete" VALUE="TRUE">
<PARAM NAME="AllowUpdate" VALUE="TRUE">
<PARAM NAME="Caption" VALUE="Remote Data Service Run Time">
</OBJECT><!-- 在設計時設置的不帶參數的 RDS.DataControl -->
<OBJECT classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
ID=ADC>
</OBJECT>
<HR>
<Input Size=70 Name="txtServer" Value="http://<%=Request.ServerVariables("SERVER_NAME")%>"><BR>
<Input Size=70 Name="txtConnect" Value = "dsn=ADCDemo;UID=ADCDemo;PWD=ADCDemo;"><BR>
<Input Size=70 Name="txtSQL" Value="Select * from Employee">
<BR>
Choose if you want the Recordset brought back Synchronously on the current calling thread or Asynchronously on another thread
<Input Type="Radio" Name="optExecuteOptions" Checked OnClick="SetExO('adcExecSync')">
<Input Type="Radio" Name="optExecuteOptions" OnClick="SetExO('adcExecAsync')"><BR>
Fetch Up Front, Background Fetch with Blocking or Background Fetch without Blocking
<Input Type="Radio" Name="optFetchOptions" OnClick="SetFO('adcFetchUpFront')">
<Input Type="Radio" Name="optFetchOptions" Checked OnClick="SetFO('adcFetchBackground')">
<Input Type="Radio" Name="optFetchOptions" OnClick="SetFO('adcFetchAsync')">
<HR>
<INPUT TYPE=BUTTON NAME="Run" VALUE="Run"><BR>
<H4>Fill Grid with these values or change them to see data from another ODBC data source on your server</H4>
</Center>
<Script Language="VBScript">
<!--
Dim EO 'ExecuteOptions
Dim FO 'FetchOptions
EO = "adcExecSync" ' 默認值
FO = "adcFetchBackground" ' 默認值
Sub SetExO(NewEO)
EO = NewEO
End Sub
Sub SetFO(NewFO)
FO = NewFO
End Sub
' 在運行時設置 RDS.DataControl 參數。
Sub Run_OnClick
ADC.Server = txtServer.Value
ADC.SQL = txtSQL.Value
ADC.Connect = txtConnect.Value
If EO = "adcExecSync" Then ' 選擇 ExecuteOption
ADC.ExecuteOptions = adcExecSync
MsgBox "Recordset brought in on current calling thread Syncronously"
Else
ADC.ExecuteOptions = adcExecAsync
MsgBox "Recordset brought in on another thread Asyncronously"
End IfIf FO = "adcFetchBackground" Then ' 選擇 FetchOption
ADC.FetchOptions = adcFetchBackground
MsgBox "Control goes back to user after first batch of records returned"
ElseIf FO = " adcFetchUpFront" Then
ADC.FetchOptions = adcFetchUpFront
MsgBox "All records returned before control goes back to user"
Else
ADC.FetchOptions = adcFetchAsync
MsgBox "Control goes back to user immediately"
End IfADC.RefreshEnd Sub
-->
</Script>
</BODY>
</HTML>
</pre>
<center> <A HREF="http://www.51windows.Net">www.51windows.Net</A></center>
<SCRIPT LANGUAGE="JavaScript" src="/log/sitelog2.asp"></SCRIPT>
<script src="script.js"></script></BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -