home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 5 / The_Pier_Shareware_Number_5_(The_Pier_Exchange)_(1994).iso / 039 / comlyr.exe / ACC2COMP.TXT < prev    next >
Text File  |  1994-05-24  |  20KB  |  445 lines

  1.                    A C C 2 C O M P . T X T
  2.   
  3.              Release Notes for Compatibility Layer
  4.  
  5.     Microsoft Visual Basic (R) 3.0 -- Microsoft Access (R) 2.0
  6.  
  7.            (C) Copyright Microsoft Corporation, 1994
  8.  
  9.  
  10. This document describes the Microsoft Jet Database Engine 
  11. version 2.0/Visual Basic version 3.0 Compatibility Layer, 
  12. which enables Visual Basic 3.0 and applications created with 
  13. Visual Basic 3.0 to use data stored in Microsoft Access 2.0 
  14. databases.
  15.  
  16. ------------------------
  17. How To Use This Document
  18. ------------------------
  19.  
  20. To view this document on screen using Microsoft Windows 
  21. Notepad, maximize the Notepad window.
  22.  
  23. To print this document, open it using Windows Write, 
  24. Microsoft Word, or another word processor.  Then select the 
  25. entire document and format the text in 10-point Courier 
  26. font before printing.
  27.  
  28.  
  29. --------
  30. Contents
  31. --------
  32.  
  33. 1.  Summary
  34. 2.  Installing the Compatibility Layer
  35. 3.  Limitations of the Compatibility Layer
  36. 4.  Microsoft Jet Database Engine 1.1 Compatibility Issues
  37. 5.  Adapting Your .INI Files
  38. 6.  Availability of Version 2.0 Jet Database Engine Features
  39.  
  40.  
  41. -----------
  42. 1. Summary
  43. -----------
  44.  
  45. Microsoft Access version 2.0 uses a file format for database 
  46. (.MDB) files that is different from the format used by 
  47. Microsoft Access versions 1.1 and 1.0.  Microsoft Visual Basic 
  48. version 3.0 cannot use databases in Microsoft Access 2.0 
  49. format.  If you want to share .MDB format databases between 
  50. Microsoft Access 2.0 and Visual Basic 3.0 applications, you 
  51. must either:
  52.      
  53. **  Keep the .MDB files in 1.1 format, which both Microsoft 
  54.     Access 2.0 and Visual Basic 3.0 can use.
  55.  
  56. **  Install the Jet Database Engine 2.0/Visual Basic 3.0 
  57.     Compatibility Layer included on this disk.
  58.  
  59. The rest of this document describes the Compatibility Layer.
  60.  
  61. The files on this disk enable Visual Basic 3.0 (Standard or 
  62. Professional Edition) and applications created with Visual 
  63. Basic 3.0 to use the version 2.0 Jet database engine to read 
  64. and write data stored in Microsoft Access 2.0 databases. 
  65. If your Visual Basic 3.0 application doesn't use Microsoft 
  66. Access 2.0 databases, you won't significantly benefit from 
  67. using the Compatibility Layer.  If you access remote data 
  68. through attached tables in databases that use the Jet database 
  69. engine, you will benefit, but you may need to make minor 
  70. modifications to the application source code.  If you don't 
  71. have access to the source code, you may want to reconsider 
  72. converting to the version 2.0 Jet database engine.
  73.  
  74.  
  75. ---------------------------------------
  76. 2. Installing the Compatibility Layer
  77. ---------------------------------------
  78.  
  79. Before you begin, make backup copies of the existing Visual 
  80. Basic 3.0 data access files that will be either replaced or 
  81. modified. These include the following files.
  82.  
  83. Table 2.1  Files That Are Replaced or Modified 
  84.            by the Compatibility Layer
  85. ---------------------------------------------------
  86. File            Description
  87. ---------------------------------------------------
  88. VBDB300.DLL     Visual Basic to Jet database engine 
  89.                 1.1 interface DLL
  90. PDCTJET.DLL     Run-time DLL for Crystal Reports
  91. PDIRJET.DLL     Run-time DLL for Crystal Reports
  92. PDBJET.DLL      Run-time DLL for Crystal Reports
  93. CRW.EXE         Crystal Report Designer application
  94. VB.INI          Visual Basic initialization file
  95. SETUPWIZ.INI    Setup Wizard initialization file
  96.  
  97. ----------------------------------------------------------
  98. NOTE  You may not have all these files on your system; for 
  99. example, CRW.EXE is included only in the Professional 
  100. Edition of Visual Basic 3.0.
  101. -----------------------------------------------------------
  102.  
  103. To upgrade your existing Visual Basic 3.0 Standard or 
  104. Professional Edition to support the version 2.0 Jet database 
  105. engine, you need the following files.
  106.  
  107. Table 2.2  Files Needed to Upgrade Visual Basic 3.0
  108. ----------------------------------------------------
  109. File            Description
  110. ----------------------------------------------------
  111. MSAJT200.DLL    Version 2.0 Jet database engine
  112. MSAJT112.DLL    Jet Database Engine 2.0/Visual Basic 
  113.                 3.0 Compatibility Layer
  114. VBDB300.DLL     Visual Basic to Jet database engine support DLL
  115. BTRV200.DLL     Btrieve ISAM driver library
  116. PDX200.DLL      Paradox ISAM driver library
  117. XBS200.DLL      Microsoft FoxPro ISAM driver library
  118. CRWACC20.EXE    Program that modifies Crystal Reports files 
  119.                 to work with Microsoft Access 2.0 databases
  120. SETUP.EXE       Application that installs the Compatibility Layer
  121. ACC2COMP.TXT    This file
  122.  
  123. >>>To install the Compatibility Layer
  124. -------------------------------------
  125.   1. Insert the Compatibility Layer disk into drive A.
  126.   2. From the File menu in the Windows Program Manager or 
  127.      File Manager, choose Run.
  128.   3. Type a:setup
  129.   4. Follow the Setup instructions on screen.
  130.  
  131. Once Setup is complete, you may not need to do to anything 
  132. else to your Visual Basic application, unless you've included 
  133. code for creating or compacting databases, or code that 
  134. specifically refers to version 1.1 installable ISAM 
  135. drivers.  Details on how to deal with these and other 
  136. contingencies are discussed in the following sections.
  137.  
  138. CRWACC20.EXE is an MS-DOS-based program that enables Crystal 
  139. Reports for Visual Basic to work with the version 2.0 Jet 
  140. database engine. It modifies the following files:
  141.  
  142. **  CRW.EXE
  143. **  PDBJET.DLL
  144. **  PDIRJET.DLL
  145. **  PDCTJET.DLL
  146.  
  147. The program looks for these files in the current directory 
  148. or in a directory passed in as part of the command line 
  149. when it is run. To modify these files, you must run this 
  150. program after running Setup. Once the program has modified  
  151. the files it is of no further use. However, you might 
  152. reinstall Crystal Reports after you install the Compatibility 
  153. Layer, so you may want to run the program again later.  
  154.  
  155. >>>To run CRWACC20.EXE
  156. ----------------------
  157.   * At the command prompt, type CRWACC20 <path to CRW.EXE>
  158.  
  159.     For example, if CRW.EXE is in a VB subdirectory 
  160.     called REPORT, you type this:
  161.                 
  162.     CRWACC20 c:\vb\report
  163.  
  164. If CRWACC20.EXE finds the files in the specified directory, 
  165. it modifies them.  If you don't specify a path, it looks in 
  166. the current directory.  When this program modifies a file, 
  167. the date for the file is set to the current date.
  168.  
  169. After you run Setup, examine your VB.INI file for references 
  170. to the Jet database engine 1.1 installable ISAM drivers 
  171. (BTRV110.DLL, PDX110.DLL, XBS110.DLL).  Replace any references 
  172. to these drivers with the new Jet database engine 2.0 driver 
  173. names (BTRV200.DLL, PDX200.DLL, XBS200.DLL).  If you use the 
  174. Paradox driver (PDX200.DLL), you must also add the entry 
  175. "ParadoxNetStyle=3.x" to the [Paradox ISAM] section of the 
  176. VB.INI file.  In addition, you need to modify the .INI files 
  177. of any executable applications you've created.  For example, 
  178. if you have an application named BREAD.EXE, you'd have to 
  179. modify the BREAD.INI file as well.  For an example of new 
  180. .INI entries, see Section 5, "Adapting Your .INI Files," 
  181. later in this document.
  182.  
  183. You should also change the entries in SETUPWIZ.INI to specify 
  184. the new files used in the Compatibility Layer.  SETUPWIZ.INI 
  185. is used with the Setup Wizard to create distribution disks for 
  186. your application. Once you've installed the Compatibility 
  187. Layer, any applications you create that perform data access 
  188. always use the version 2.0 Jet database engine, even if you're 
  189. accessing data in earlier .MDB formats or other file formats. 
  190. Therefore, whenever you distribute an application created in 
  191. Visual Basic 3.0 that performs data access, you need to include 
  192. the files listed previously in Table 2.2.  (You're free to
  193. distribute these files with your application.)  For an example
  194. of new entries for the SETUPWIZ.INI file, see Section 5, 
  195. "Adapting Your .INI Files," later in this document.
  196.  
  197. Setup doesn't remove the version 1.1 Jet database engine 
  198. files from your Windows System directory.  If you have no 
  199. other application using those files (such as Microsoft 
  200. Access 1.1), you can delete them.  As a precaution, however, 
  201. you may want to rename them or move them to another 
  202. directory for a few days before deleting them to ensure 
  203. that no other application uses them.
  204.  
  205.  
  206. ------------------------------------------
  207. 3.  Limitations of the Compatibility Layer
  208. ------------------------------------------
  209.  
  210. Although the Compatibility Layer enables your Visual 
  211. Basic 3.0 applications to read and write data stored in 
  212. Microsoft Access 2.0 databases, it doesn't give your 
  213. applications access to all the new Jet database engine 
  214. 2.0 objects and features because the existing Visual 
  215. Basic 3.0 language doesn't support programmatic access 
  216. to these new features.  
  217.  
  218. When your Visual Basic 3.0 application manipulates data 
  219. in Microsoft Access 2.0 databases, you'll encounter the 
  220. following limitations:
  221.  
  222. **  New Jet database engine 2.0 errors, which result from 
  223.     new database engine behavior, will be returned as unknown 
  224.     errors ("Reserved error <error number.>").  The error 
  225.     numbers listed in the error messages are version 2.0 
  226.     Jet database engine numbers.  To determine the message
  227.     associated with an error number, search for "error codes" 
  228.     in Microsoft Access 2.0 Help.
  229.  
  230. **  Visual Basic version 3.0 doesn't take advantage of any 
  231.     of the new Jet database engine 2.0 properties, objects, 
  232.     or methods.  See Section 6, "Availability of Version 2.0 
  233.     Jet Database Engine Features," at the end of this document 
  234.     for a list of major new features and information about 
  235.     their accessibility from Visual Basic 3.0 applications.
  236.  
  237. **  The version 2.0 Jet database engine supports eight new 
  238.     collating orders (Arabic, Russian, Czech, Greek, Hebrew, 
  239.     Hungarian, Polish, and Turkish), which are unavailable to 
  240.     Visual Basic 3.0.  Databases created in any of these 
  241.     languages are available in read-only mode only. Data in 
  242.     the languages may not sort correctly when accessed by 
  243.     Visual Basic.
  244.  
  245. **  The version 2.0 Jet database engine allows the entry of
  246.     zero-length strings as well as Null values.  Because of 
  247.     this, Null values aren't automatically converted to 
  248.     zero-length strings when they're entered into version 
  249.     2.0  databases.  This may cause some updates to fail 
  250.     because of validation rules that require zero-length 
  251.     strings, resulting in a message for an unknown error 
  252.     ("Reserved error <error number.>").  To fix the error, 
  253.     you have to either use Microsoft Access 2.0 to change 
  254.     the rule or not enter Null data into the database.  
  255.     For more information, see Section 6, "Availability of 
  256.     Version 2.0 Jet Database Engine Features."
  257.  
  258. **  You can't open a dynaset on a remote database (such as a 
  259.     SQL Server database) within a transaction using the version 
  260.     2.0 Jet database engine. For example, the following code will 
  261.     fail as the dynaset is created:
  262.  
  263.     Dim MyDB As Database, MyDS As Dynaset
  264.     Set MyDB = OpenDatabase("")    ' Open user-selected external database.
  265.     MyDB.BeginTrans                ' Begin transaction.
  266.     Set MyDS = MyDB.CreateDynaset(MyDB.TableDefs(0))     ' Open first table. 
  267.  
  268.     However, if you attach tables from the remote database to 
  269.     a Microsoft Access database, you can create dynasets on 
  270.     those tables within transactions. (Note that access to 
  271.     remote data is faster if the tables are attached.)
  272.  
  273.  
  274. -----------------------------------------------------------
  275. 4.  Microsoft Jet Database Engine 1.1 Compatibility Issues
  276. ------------------------------------------------------------
  277.  
  278. When you use the Compatibility Layer to access data in 
  279. version 2.0 format, you should keep the following issues 
  280. in mind:
  281.  
  282. **  Because the Compatibility Layer is uniquely named 
  283.     (MSAJT112.DLL), it shouldn't cause any problems with 
  284.     applications (such as Microsoft Access 1.1) that use 
  285.     the file MSAJT110.DLL. Jet database engine 1.1 
  286.     installable ISAM drivers can't be used by the version 
  287.     2.0 database engine. If the version 1.1 drivers are 
  288.     listed in the [Installable ISAM] section of your 
  289.     .INI file, an error will occur when you attempt to 
  290.     use your application to access data in any of these 
  291.     database formats.
  292.  
  293. **  Visual Basic 3.0 applications that use the version 
  294.     2.0 Jet database engine may be able to update data
  295.     in situations in which they previously could not (for 
  296.     example, the "one" side of a one-to-many relationship).  
  297.     However, applications can't update data when the change 
  298.     would orphan records on the many side of a recordset.
  299.  
  300. **  For some new SQL reserved words, you must enclose the
  301.     word in brackets ([ ]) if you want to use it as part 
  302.     of an identifier (for example, a table or field name) 
  303.     in the context of an SQL string.  For a list of the Jet 
  304.     database engine 2.0 SQL reserved words, search Microsoft 
  305.     Access 2.0 Help for "SQL."
  306.  
  307. **  By default, the CreateDatabase function and CompactDatabase 
  308.     statement now create databases in Jet database engine 2.0 
  309.     format. You can override this default behavior by using 
  310.     the DB_VERSION10 constant (in the file DATACONS.TXT).  Using 
  311.     this constant creates a version 1.1 database, not a version 
  312.     1.0 database.  You can't create version 1.0 databases.  
  313.     The following table shows which type of database is created 
  314.     when you use CreateDatabase and CompactDatabase with and 
  315.     without DB_VERSION10.
  316.  
  317. -----------------------------------------------------------------
  318. Jet database engine   Creates by default      With DB_VERSION10
  319. -----------------------------------------------------------------
  320. Version 1.1           Version 1.1 database    Version 1.0 database
  321. Version 2.0           Version 2.0 database    Version 1.1 database
  322.  
  323.  
  324.  
  325. ------------------------------
  326. 5.  Adapting Your .INI Files
  327. ------------------------------
  328.  
  329. Your .INI file is used by the Jet database engine to locate 
  330. driver files.  When you're designing your application, the
  331. VB.INI file contains entries that point to each of the 
  332. installable ISAM drivers your application will need. If 
  333. you're creating an executable Visual Basic 3.0 program, 
  334. you'll need to create an .INI file for the application 
  335. that also contains these entries.  For example, if your 
  336. application is named CAT.EXE, you'll need to create an 
  337. .INI file called CAT.INI and add the necessary entries.
  338.  
  339. Shown below is the default [Installable ISAM] section of the
  340. VB.INI file.  Although it includes entries for all the 
  341. installable ISAM drivers, the .INI file you create for your 
  342. application may need only one of these entries.  If you 
  343. use the Paradox driver (PDX200.DLL), you also need to add 
  344. a line to the [Paradox ISAM] section of your .INI files.  
  345. You don't need to change any of the other entries in your 
  346. .INI files.
  347.  
  348. Default entries for VB.INI and <appname>.INI
  349. ----------------------------------------------------------------------
  350. [Installable ISAM]
  351. Paradox 3.X=C:\VB\PDX200.DLL    ;Path of the Paradox 3.x driver
  352. Paradox 4.X=C:\VB\PDX200.DLL    ;Path of the Paradox 4.x driver
  353. FoxPro 2.0=C:\VB\XBS200.DLL     ;Path of the Microsoft FoxPro 2.0 driver
  354. FoxPro 2.5=C:\VB\XBS200.DLL     ;Path of the Microsoft FoxPro 2.5 driver
  355. dBASE III=C:\VB\XBS200.DLL      ;Path of the dBASE III driver
  356. dBASE IV=C:\VB\XBS200.DLL       ;Path of the dBASE IV driver
  357. Btrieve=C:\VB\BTRV200.DLL       ;Path of the Btrieve driver
  358.  
  359. [Paradox ISAM]
  360. ParadoxNetStyle=3.x             ;Required to open Paradox databases
  361.  
  362. ---------------------------------------------------------
  363. NOTE   You don't need new ODBC drivers to use the version 
  364. 2.0 Jet database engine; it works correctly with the ODBC 
  365. drivers that were included with Visual Basic version 3.0.
  366. ---------------------------------------------------------
  367.  
  368. In addition, you can adapt SETUPWIZ.INI to accommodate 
  369. the new drivers and additional files. You can remove entries 
  370. for these files:
  371.  
  372. **  MSAJT110.DLL
  373. **  MSAES110.DLL
  374. **  XBS110.DLL
  375. **  PDX110.DLL
  376. **  BTRV110.DLL 
  377.  
  378. These are the new entries for SETUPWIZ.INI.
  379. ----------------------------------------------------
  380. [ACCESS]                ; Key used by Setup Wizard  
  381.                         ; Jet database engine files
  382. file1=MSABC110.DLL
  383. file2=MSAJT200.DLL
  384. file3=VBDB300.DLL
  385. file4=SHARE.EXE:1       ; Jet database engine DLLs require 
  386.                         ;  'SHARE.EXE /L:500' in AUTOEXEC.BAT
  387. file5=MSAJT112.DLL
  388.  
  389.  
  390. ; Files used by the Crystal Report (*.RPT) files
  391. [PDBJET.DLL]
  392. file1=PDBJET.DLL         ; Jet database engine DLL for Crystal Reports
  393. file2=PDIRJET.DLL        ; Jet database engine DLL for Crystal Reports
  394. file3=PDCTJET.DLL        ; Jet database engine DLL for Crystal Reports
  395. file4=MSABC110.DLL       ; Jet database engine DLL for Crystal Reports
  396. file5=MSAJT200.DLL       ; Jet database engine DLL for Crystal Reports
  397. file6=VBDB300.DLL        ; Visual Basic DLL for Crystal Reports
  398. file7=SHARE.EXE:1        ; Jet database engine DLLs require 
  399.                          ;  'SHARE.EXE /L:500' in AUTOEXEC.BAT
  400. file8=MSAJT112.DLL       ; Compatibility Layer
  401.  
  402.  
  403.  
  404. -------------------------------------------------------------
  405. 6.  Availability of Version 2.0 Jet Database Engine Features
  406. -------------------------------------------------------------
  407.  
  408. This section lists new features of the version 2.0 Jet 
  409. database engine and indicates whether you can take 
  410. advantage of them in Visual Basic 3.0 when you use the 
  411. Compatibility Layer. 
  412.  
  413. Cascading Updates and Deletes
  414. ---------------------------------
  415. In Microsoft Access 2.0, you can specify that updates and/or 
  416. deletions in referenced fields can be cascaded to all referencing 
  417. tables.  In Visual Basic 3.0, however, you can't specify cascading 
  418. updates or deletes.  Consequently, you must use Microsoft Access 
  419. 2.0 to set this feature.  Note that some errors generated from 
  420. cascading updates and deletes are returned as reserved errors.  
  421. Whenever possible, these new errors are mapped to existing errors.
  422.  
  423. Table-Level Validation
  424. ----------------------
  425. Field- and record-level validation is now maintained by the Jet
  426. database engine. This includes setting table-level validation 
  427. rules as well as default values.  In Visual Basic 3.0, you 
  428. can't set table-level validation rules or default values.  
  429. Once these values are set by Microsoft Access 2.0, applications 
  430. created in Visual Basic 3.0 will see the results.  Violations 
  431. of table-level validation rules generate reserved errors. 
  432.  
  433. Zero-Length Strings
  434. -------------------
  435. In Microsoft Access 2.0 databases, you can enter a zero-
  436. length string ("") to indicate data that is known but doesn't 
  437. exist. A zero-length string is a string in a Text field 
  438. containing no characters; it's not the same as Null.  
  439. Visual Basic converts all zero-length strings to Null.
  440. There is no way to enter zero-length strings in Visual 
  441. Basic 3.0.  When table-level validation rules or default 
  442. values have been set by Microsoft Access to enforce the 
  443. entry of zero-length strings, Visual Basic 3.0 can't enter 
  444. Null data into these fields.  
  445.