Microsoft KB Archive/187393

= BUG: "Error in Assignment" Accessing BLOB Data in FoxPro DB =

Article ID: 187393

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft Open Database Connectivity Driver for Visual FoxPro 3.0
 * Microsoft Open Database Connectivity Driver for Visual FoxPro 4.0
 * Microsoft Open Database Connectivity Driver for Visual FoxPro 5.0

-



This article was previously published under Q187393



SYMPTOMS
When you use an MFC Crecordset to access BLOB data in the General Field of a Visual FoxPro (VFP) database, using the Visual FoxPro Driver (version 3.0 and 5.0), ODBC trace generates the following error message while performing the SQLGetData:

[Microsoft][ODBC Visual FoxPro Driver]Driver not capable

-and-

[Microsoft][ODBC Visual FoxPro Driver]Error in assignment



CAUSE
The Microsoft Visual FoxPro Driver fails to return any data when two SQLGetdata ODBC calls are made in succession. CRecordset performs the two successive SQLGetData calls to retrieve BLOB data as follows:


 * SQLGetData: To get the size of the BLOB data. -and-
 * SQLGetData: To get the actual Binary Data.



RESOLUTION
Use the Jet IISAM for FoxPro, version 3.51.102900 or higher, instead of the Visual FoxPro 3.0 - 5.0 driver to retrieve the data. The IISAM for FoxPro only supports read-only cursor types.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
The following steps cause the error to occur:  Create a FoxPro Database named Data1.dbc with a table named Test1.dbf. The table contains two fields:

Numeric - NUMBER

General - GENFLD with the Bitmap.

NOTE: Add at least one record to the table. Using the ODBC Administrator, create a data source name (DSN), named Test, using the Visual FoxPro driver to access the FoxPro database data1.dbc.

 Select Visual FoxPro Database (.dbc) as the Database type. Browse or enter the path to the .dbc in the path edit box.</li></ol>

NOTE: Use ODBC Test to complete the following steps:

</li> From the Connection menu, choose Full Connect using the Test Data Source.</li>  Type the following SELECT statement in the input window for the current connection: SELECT 'NUMBER', 'GENFLD' FROM 'test1' </li> From the Stmt menu, select SQLExecDirect.</li> Select the Results menu and choose SQLFetch.</li> Select the Results menu and choose SQLGetData setting the Column Number to 1, Target Type to SQL_C_DEFAULT, and Buffer Length to zero in the SQLGetData dialog box. Click OK.</li> From the Results menu, choose SQLGetData. Set Column Number to 2, Target Type to SQL_C_BINARY, and Buffer Length to 374299 in the SQLGetData dialog box. Click OK.

The following error occurs:

MessageText = "[Microsoft][ODBC Visual FoxPro Driver]Error in assignment"

</li></ol>

Additional query words: kbDSupport kbvfp kbDriver kbODBC kbdse

Keywords: kbbug kbpending KB187393

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.