Visual Basic 6 Black Book:Working With Database Objects In Code
function GetCookie (name)
{
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg) {
var end = document.cookie.indexOf (";", j);
if (end == -1)
end = document.cookie.length;
return unescape(document.cookie.substring(j, end));
}
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
var m1='';
var gifstr=GetCookie("UsrType");
if((gifstr!=0 ) && (gifstr!=null)) { m2=gifstr; }
document.write(m1+m2+m3);
Keyword
Title
Author
ISBN
Publisher
Imprint
Brief
Full
Advanced Search
Search Tips
Please Select
-----------
Components
Content Mgt
Certification
Databases
Enterprise Mgt
Fun/Games
Groupware
Hardware
IBM Redbooks
Intranet Dev
Middleware
Multimedia
Networks
OS
Prod Apps
Programming
Security
UI
Web Services
Webmaster
Y2K
-----------
New Titles
-----------
Free Archive
To access the contents, click the chapter and section titles.
Visual Basic 6 Black Book
(Publisher: The Coriolis Group)
Author(s): Steven Holzner
ISBN: 1576102831
Publication Date: 08/01/98
function isIE4()
{
return( navigator.appName.indexOf("Microsoft") != -1 && (navigator.appVersion.charAt(0)=='4') );
}
function bookMarkit()
{
var url="http://www.itknowledge.com/PSUser/EWBookMarks.html?url="+window.location+"&isbn=0";
parent.location.href=url;
//var win = window.open(url,"myitk");
//if(!isIE4())
// win.focus();
}
Search this book:
Previous
Table of Contents
Next
DAO: Executing SQL
You can execute an SQL statement when you create a DAO record set using the OpenRecordset method by placing that SQL statement in the source argument:
Set recordset = Database.OpenRecordset ( source, type, options, lockedits)
Here are the arguments for OpenRecordset:
sourceA string specifying the source of the records for the new Recordset. The source can be a table name, a query name, or an SQL statement that returns records. (For table-type Recordset objects in Jet-type databases, the source can only be a table name.)
typeIndicates the type of Recordset to open.
optionsCombination of constants that specify characteristics of the new Recordset.
lockeditsConstant that determines the locking for Recordset.
Here are the possible settings for type:
dbOpenTableOpens a table-type Recordset object.
dbOpenDynamicOpens a dynamic-type Recordset object, which is like an ODBC dynamic cursor.
dbOpenDynasetOpens a dynaset-type Recordset object, which is like an ODBC keyset cursor.
dbOpenSnapshotOpens a snapshot-type Recordset object, which is like an ODBC static cursor.
dbOpenForwardOnlyOpens a forward-only-type Recordset object.
Here are the possible settings for options:
dbAppendOnlyAllows users to append new records to the Recordset but prevents them from editing or deleting existing records (Microsoft Jet dynaset-type Recordset only).
dbSQLPassThroughPasses an SQL statement to a Microsoft Jet-connected ODBC data source for processing (Microsoft Jet snapshot-type Recordset only).
dbSeeChangesGenerates a runtime error if one user is changing data that another user is editing (Microsoft Jet dynaset-type Recordset only).
dbDenyWritePrevents other users from modifying or adding records (Microsoft Jet Recordset objects only).
dbDenyReadPrevents other users from reading data in a table (Microsoft Jet table-type Recordset only).
dbForwardOnlyCreates a forward-only Recordset (Microsoft Jet snapshot-type Recordset only). It is provided only for backward compatibility, and you should use the dbOpenForwardOnly constant in the type argument instead of using this option.
dbReadOnlyPrevents users from making changes to the Recordset (Microsoft Jet only). The dbReadOnly constant in the lockedits argument replaces this option, which is provided only for backward compatibility.
dbRunAsyncRuns an asynchronous query (ODBCDirect workspaces only).
dbExecDirectRuns a query by skipping SQLPrepare and directly calling SQLExecDirect (ODBCDirect workspaces only).
dbInconsistentAllows inconsistent updates (Microsoft Jet dynaset-type and snapshot-type Recordset objects only).
dbConsistentAllows only consistent updates (Microsoft Jet dynaset-type and snapshot-type Recordset objects only).
Here are the possible settings for the lockedits argument:
dbReadOnlyPrevents users from making changes to the Recordset (default for ODBCDirect workspaces).
dbPessimisticUses pessimistic locking to determine how changes are made to the Recordset in a multiuser environment.
dbOptimisticUses optimistic locking to determine how changes are made to the Recordset in a multiuser environment.
dbOptimisticValueUses optimistic concurrency based on row values (ODBCDirect workspaces only).
dbOptimisticBatchEnables batch optimistic updating (ODBCDirect workspaces only).
A Full-Scale RDO Example
To illustrate RDO data handling in code, well build a fully functional RDO projectthe rdocode projectover the next few examples. You can see that project at work in Figure 25.4. This program is designed to open the ODBC data source we set up in the previous chapter (where we created a database, db.mdb, and registered it as an ODBC data source) and let the user move around in it record by record.
Figure 25.4 The rdocode project opening an ODBC database.
Using the buttons in the rdocode project, you can move through the database, and well see how to write the code for the rdocode project in the following few topics. For reference, the code for this example is located in the rdocode folder on this books accompanying CD-ROM.
Previous
Table of Contents
Next
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.
Wyszukiwarka
Podobne podstrony:
489 Polska reklamaq51 874 4874 (2)876 2011876 tabela handlowa s2 048 06 2013876 879SPP 874?4KRUPS F 874874 878876 (2)więcej podobnych podstron