Tutorials to .com

Tutorials to .com » Asp » Database » Data access page to bind to the disconnected recordset

Data access page to bind to the disconnected recordset

Print View , by: iSee ,Total views: 14 ,Word Count: 576 ,Date: Mon, 25 May 2009 Time: 6:11 PM

Meyyammai Subramanian
Microsoft Corporation

April 2001

Apply to:
Microsoft ® access 2002

Abstract: This paper explains how data access pages will be bound to the ADO disconnected recordset.

Contents
Introduction
Create a record of the use of disconnected data access page set

Introduction
Disconnect the recordset is a client-side cache of objects, the object is not real-time access to the same server. The use of disconnected recordsets, ActiveX ® Data Objects (ADO) allow you to create a recordset, disconnect and connect the data source so that users can view and edit offline recordset.

For example, the "category" data access page will be asked whether the page should be used disconnected data. If the user clicks "Yes", the page will be prompted to disconnect the user to enter the path of the recordset. If the user clicks "No", the page will use real-time data.

Create a record of the use of disconnected data access page set
In the "Design" view to create a data access page.


Add the necessary controls and division level. For example, create a "category" page, which have different combinations of products under the category of records.


Added to the code BeforeInitialBind events in order to connect to the disconnected recordset, or to connect to real-time data.
The following is a sample BeforeInitialBind course of the incident.

<SCRIPT Language=vbscript event=BeforeInitialBind(info) for=MSODSC>
<! --
Dim rs
Dim strShapeText
Dim strConnectionString
Dim strDataSource
adOpenKeyset = 1
adLockOptimistic = 3

If vbyes = msgbox ( "the use of disconnected recordsets you?", Vbyesno) Then
On Error Resume Next
strDataSource = InputBox ( "Please enter to use the _
Disconnect the path of the recordset. "," Enter Path ", _
"C: \ Program Files \ Microsoft Office \ Office10 \ Samples \ _
Northwind.mdb ")
strShapeText = MSODSC.RootRecordsetDefs (0). ShapeText
strConnectionString = "Provider = MSDataShape.1; _
Persist Security Info = False; Data Source = "& strDataSource _
& "; User ID = Admin; Data Provider = Microsoft.Jet.OLEDB.4.0"

Set rs = CreateObject ( "ADODB.Recordset")
rs.Open strShapeText, strConnectionString, adOpenKeyset, _
adLockOptimistic

If err.Number <> 0 Then
MsgBox "Error:" & err.description & "Error" & err.number
End If

MSODSC.SetRootRecordset "Categories", rs
End If
->
</ SCRIPT>

Note:

Microsoft Access can not bind to normal use within disconnected recordset of the data access page. Microsoft Internet Explorer should open the page to normal view.


Microsoft ® Office in the creation of data source controls (MSODSC) events in Visual Basic ® Scripting Edition (VBScript) blocks, the parameters must be added to the event name as follows:
<SCRIPT LANGUAGE=vbscript FOR=MSODSC EVENT=Current(oventInfo)>

oEventInfo parameters to the script for the return of the incident specific information. Regardless of whether or not to use this parameter, we must add this parameter, otherwise the script will not be able to run.


ASP Database Related Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.