Visual Basic Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘ODBC’

PRB: RDC/ODBC Password Display Inconsistencies

Symptoms
When setting the password property of the RemoteData Control (RDC) atdesign time in the Property Window, asterisks are not substituted for thepassword characters. When the ODBC dialog box is displayed, the password isconverted into asterisks.
Resolution
The RDC does not control the edit field in the Property Window, andtherefore cannot force asterisks to be displayed. An OLE custom controldoes not have direct control over the Property window supplied by theVisual Basic design environment. The Remote Data control does correctly useasterisks in its own Property page.

PRB: Opening an ODBC Database Inside a Jet Workspace Hangs VB

Symptoms
Attempting to use a Jet workspace to open an ODBC datasource based on a Jetdatabase can cause Visual Basic to hang. This is essentially causing Jet totalk to itself. This is not a supported way of accessing an Access/Jetdatabase.
Resolution
You can use an ODBC workspace to open an ODBC datasource based on a Jetdatabase. You can also open a Jet database directly, without an using anODBC datasource.

PRB: Jet Doesn’t Support QueryDefs on a Non-Attached ODBC Table

Symptoms
Jet does not support named QueryDefs on a non-attached ODBC database. A nonattached ODBC database is one that is opened directly with theOpenDatabase method of the WorkSpace object without the use of an .mdb file.
Resolution
The preferred method for opening an external ODBC table is to attach it toan .mdb file. For additional information, please see the followingarticle(s) in the Microsoft Knowledge Base:
150716?(http://support.microsoft.com/kb/150716/EN-US/): DAO: How To Attach to and Create QueryDefs on ODBC Tables
If this method is not appropriate for your application, the followingexample shows how to createQuerydefs with no name:

Set qd = db.CreateQueryDef(“”)qd.SQL = “Select * from authors”

BUG:Wrong Default Value in Remote Data Object MaxRows Property

Symptoms
Some ODBC drivers require the MaxRows property of the Remote Data Object tobe set to 0. The default value for this property is -1.
Resolution
Microsoft has confirmed this to be an issue in the Microsoft productslisted at the beginning of this article. Microsoft is researching thisissue and will post new information here in the Microsoft Knowledge Baseas it becomes available.

PRB: Cannot Update VFP Free Table Using FoxPro ODBC ISAM Drive

Symptoms
In systems that do not have MDAC 2.1 installed on them, when you use the FoxPro ODBC ISAM Driver (named “Microsoft FoxProDriver(*.dbf)” in the ODBC Administrator) for 2.5 or 2.6 tables, it allowsyou to view the contents of a table created in Visual FoxPro. However, whenyou try to update or add new records, the following error message mightappear:

Operation must use an Updateable Query.
Resolution
The older ISAM driver is not able to accurately read the table header ofthe Visual FoxPro table. Visual FoxPro supplies additional information inthe header of the table for links to a database container, which the olderISAM ODBC driver does not accommodate. Snapshot recordsets are updateableas long as the table is in 2.5 or 2.6 format.

PRB: “Operation Must Use an Updateable Query” Error Message When You Access Excel Through ODBC

Symptoms
When you edit an Excel worksheet through ADO and ODBC, you may receive the following error message if you use an ADO DataControl object:

[Microsoft][ODBC Excel Driver] Operation must use an updateable query.If you use a Recordset object that is generated with ADO code, you may receive the following error message when you edit an Excel worksheet through ADO and ODBC:

Run-time error ‘-2147467259(80004005)’:[Microsoft][ODBC Excel Driver] Operation must use an updateable query.
Resolution
This problem occurs if you try to edit a worksheet that is saved or opened as ReadOnly.
NOTE: ReadOnly is the default setting for an ODBC connection to Excel, with or without a data source name (DSN). Therefore, the user must always change that setting to edit data.