I have been doing a DataGrid link DBF database for a DATAGRID. DataGrid's data is ADO Recordset. An error occurred inside the ADO during operation of the DBF file. These errors are very difficult to debug. We know that ADO is operating through the OLE DB. These operations are usually converted to the SQL statement for the database. If we can know what the final SQL statement is, we have a great help to debug. The connection string of my link database is: "provider = microsoft.jet.oledb.4.0; data source = c: /; extended profment = dbase 5.0".
Finding the registry to get the file to implement the provider is: msjetoledb40.dll. Viewing this file with a Depends tool found that only 3 interfaces are exported to usually export. What is still in the interior still don't know. Find its symbol file, msjetoledb40.pdb. Just use the text tool to open it, it will find the shadow of the OLE DB COM excuse and function. Export his symbol with a pdbdump tool. It's more clear this time! Soon finding a symbol: setcommandtext @ cimpicommandtext @@ uagjabu_guid @@ pbg @ z, apparently cimpicommandtext is a class that implements the ICommandText interface. If you write Ole DB Provider, you will know that the second parameter of SetCommandText is saved with the mysterious SQL character. string. I want to see what is it!
Next, it is necessary to set up on the setcommandtext function, this breakpoint is not good. Seeing the function output of pdbdump is
Test it. When I modify the value in the DataGrid, the breakpoint will be activated immediately, and the string display is really the "Update" statement on the ADO reference book.