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 for the ‘data access’ Category

PRB: Cannot Connect Data Control to a Password Protected MDB

Symptoms
If you attempt to use the Data control to connect to a password-protectedAccess database at design time, you receive the following error message:

Not a valid passwordSpecifically, this error occurs when you set the RecordSource property of the Data control.
Resolution
In the Properties window, set the following properties for the Datacontrol:

PropertyValue of Property————————————-DatabaseNameATEST.MDBConnect;pwd=aaaRecordSourceTable1
NOTE: You must set the DatabaseName property first, then set the connect property. If the properties are not set in this order, you receive the same error message.
IMPORTANT: This functionality is broken in Microsoft Visual Studio 6.0 Service Pack 4 (SP4).

PRB: Calculated Field Contents Cannot be Modified by ADO

Symptoms
Trying to modify the contents of a calculated field within an ActiveX Data Objects (ADO) recordset, generates the following error:

Runtime error ‘-2147217887(80040e21)’ errors occurred.
Resolution
Each calculated field in an ADO recordset contains the following attributes:
adFldUnknownUpdatable = False
-and- adFldUpdatable = False This indicates that the field cannot be modified.

PRB: Binding Hierarchical Recordset in Data Environment

Symptoms
In Data Environment, when a hierarchical recordset is used, and theparent/child/grandchild recordsets are bound, the expected behavior is forall the child/grandchild recordsets to “stay in sync” with the parent.However, when record in the parent table moves, the grandchild recordsetdoes not receive notification that it needs to retrieve the currentchapter. This creates a situation in which the grandchild recordset becomesout of sync.
Resolution
This behavior is by design.

PRB: ADO: Compile Error: User-Defined Type Not Defined

Symptoms
When you compile your ADO project, you receive the following error:

Compile error:User-defined type not definedThis can occur on either a Connection or Command object.
Resolution
You may have referenced one of the following libraries instead of theMicrosoft ActiveX Data Objects (ADODB) type library:Microsoft ActiveX Data Objects Recordset (ADOR) type library.
-or-Microsoft ActiveX Data Objects (Multi-dimensional) (ADOMD) type library.

PRB: ADO to SQL Server Through ODBC Does Not Support adAsyncFetchNonBlocking When You Use Server-Side Cursors

Symptoms
If you attempt to use ActiveX Data Objects (ADO) to access SQL Server databases through the ODBC provider (MSDASQL), you will receive the following error if you specify adAsyncFetchNonBlocking with Server-side cursors:

-2147217890 lRowsOffset would position you past either end of the rowset, regardless of the cRows value specified; cRowsObtained is 0. The following error is returned from ADO 2.5:

-2147217890 No rows were returned because the offset value moves the position before the beginning or after the end of the rowset.NOTE: If you are using the SQLOLEDB provider you will not see this error message. However, fetching is still not supported for the cursor and it is blocked until the cursor is fully populated.
Resolution
The adAsyncFetchNonBlocking recordset option is not supported with a Server cursor. Additional enhancements would be required for the server and client in order to implement this feature. The two way communication necessary to support adAsyncFetchNonBlocking with a server cursor is not available at this time.

PRB: 8570 Report Sections Do Not Match DataSource

Symptoms
When you use a Report Control that is bound to a Visual Basic Data Environment command object and perform a GroupBy, you receive the following error:

8570 Report sections do not match data source
Resolution
One of the following has occurred:The DataReport is bound to an ungrouped recordset.The DataReport was created before binding the recordset.