The information in this article applies to:
SUMMARY
The information below includes the documentation and workarounds for Visual
Basic 6.0. This information can also be found in the README.htm file that
ships with Visual Basic 6.0 on the Visual Basic 6.0 CD-ROM. Please see the
REFERENCES section of this article for a list of the Microsoft Knowledge
Base articles relating to the Visual Basic 6.0 readme.
MORE INFORMATIONError in Data Environment Designer Code ExampleIn the topic, "Programmatically Accessing Objects in Your Data Environment Designer," the example under "Executing a Command Object with Multiple Parameters" erroneously uses the Open method:
There is no Open method for the Commands object. You must use the Execute method instead. Incompatibilities with Data-bound ControlsDue to changes in Visual Basic 6.0, not all data-bound controls are compatible with all data sources. This incompatibility is due to a difference in the internal binding mechanisms of ADO versus DAO/RDO. Controls that were created specifically to work with DAO/RDO can't be bound to an ADO Data control; controls created for use with ADO can't be bound to the standard Data control or the Remote Data Control.This incompatibility primarily applies to complex-bound controls such as grids or lists that bind to multiple fields in a data source; simple-bound controls such as text boxes or labels that bind to a single field will work with either type of data source. Some examples are as follows:
Binding to Properties of Objects May Yield Unexpected ResultsWhile it is possible to bind any object to any other object, the results may not always be what you expect. Some properties are read-only bindable and will not update their bound source.For example, if you were to bind the Caption property of a Frame control to a field named Foo in an ADO Recordset object, the Caption would change to reflect the value of Foo as you scrolled through the Recordset. If, however, you changed the Caption property programmatically (Frame1.Caption = "Bar"), the value of Foo would not be updated. Because the Caption property of the Frame is read-only bindable, it doesn't provide notification that its data has changed. This isn't a problem for Visual Basic-authored objects, since you can call the PropertyChanged method in your object's code. For other objects, you can determine if a property is update bindable by checking the DataBindings collection. If a property is enumerated in the DataBindings collection, it is update bindable and the data source will receive updates to data; if it isn't enumerated, the property is read-only bindable. Complex Binding to an ADO Recordset Requires CursorTypeWhen binding an ADO Recordset object to a complex-bound control (such as a Grid control), it is necessary to explicitly set the CursorType property to either adOpenStatic or adOpenKeyset. If you don't set this property, no data will be displayed. The following code shows the use of the CursorType property:
Binding to a simple-bound control (such as a TextBox) doesn't require
a specific CursorType.
Creating Visual Basic Data Sources: Type the Fields as adVarChar for SQL Server and Access Databases Instead of adBSTRWhen appending fields to an ADO Recordset object for use with a SQL Server or Access database, type the fields as adVarChar instead of adBSTR (as shown in some sample code). When reading data out of either SQL Server or Access databases, ADO will use the adVarChar type.Incorrect References for Creating OLE DB ProvidersThe documentation erroneously states that it is possible to set a class module's DataSourceBehavior property to 2 - vbOLEDBProvider to create an OLE DB data provider. The correct values for DataSourceBehavior are 0 - vbNone and 1 - vbDataSource.The documentation also erroneously refers to a non-existent event in class modules called OnDataConnection. Finally, in the topic "Creating the MyDataSource Class," the step-by-step example incorrectly states that you should set DataSourceBehavior to 2 - vbOLEDBProvider. Instead, you should set DataSourceBehavior to 1 - vbDataSource. To create OLE DB data providers using Visual Basic, use the Provider Writer Toolkit included with the OLE DB SDK. For more information, see the OLE DB Simple Provider Toolkit in the Platform SDK Documentation on MSDN. Finding Help For ADO ObjectsWhen using the ADO objects, (for example, Recordset, Connection, Command, Parameter, ADOR, RDS, and RDS Server object), you cannot get context- sensitive help on the object or its properties, events, or methods. That is, if you have a reference to the object and you use one of its features, selecting the code and pressing F1 does not result in a help topic. Instead, you will get either a wrong topic or the "Keyword Not Found" topic.However, you can get help on any of the object's properties, events, or methods by using the online documentation Index:
SQL Server OLE DB Provider Requires New instcat.sqlBefore using the SQL Server OLE DB data provider, you must run the version of instcat.sql distributed with Microsoft Visual Basic 6.0 on SQL Server (version 6.5 and later). Instcat.sql is distributed with Visual Basic 6.0 and can be found in the \winnt\system32 directory upon installation.If Instcat.sql is not run on your SQL Server, the provider is unable to retrieve metadata from the SQL Server, and thus will not be able to connect to that server. Setup for Data Access Applications May Fail on Windows 95/98When redistributing a Visual Basic 6.0 application that includes data access components, setup will fail if DCOM for Windows 95 and Windows 98 isn't present on Windows 9x client machines.The file Mdac_typ.exe is added to your setup package by the Package and Deployment Wizard if your project includes references to ADO, OLEDB, or ODBC (you can check for this on the Included Files page of the wizard). This file installs MDAC 2.0 files on the client computer. MDAC 2.0 requires DCOM for Windows 95 and Windows 98 in order to function properly, however it does not perform a check for this during setup. The setup will fail if DCOM for Windows 95 and Windows 98 isn't present on the client machine. Some of the older data access components will be overwritten prior to the failure, possibly causing older data access applications on the client to fail. When distributing data access applications for Windows 9x, you need to make sure that DCOM for Windows 95 and Windows 98 is installed on the client. DCOM98.EXE is a self-extracting executable file that installs the updated DCOM components for Windows 95 or Windows 98. It can be found in the DCOM98 directory of the Visual Basic 6.0 CD. This file may be freely distributed with your Visual Basic application. REFERENCES
For additional information, please see the following articles in the
Microsoft Knowledge Base:
Q170164 : INFO: VB 6.0 Readme Part 1: Important Issues [ASCII 150] Read First! Additional query words:
Keywords : kbreadme kbwizard kbADO kbAppSetup kbDAO kbDatabase kbDataBinding kbDCOM kbMDAC kbOLEDB kbVBp kbVBp600 kbVS600 kbDataEnv |
Last Reviewed: May 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |