Today, the news system of the business group project has issued a problem. It has been errors when obtaining data from the AdoDB._Recordset interface. When trying to get a field value directly from the RECORDSET interface, such as: id = rs.field ["ID"]. Value.tostring (), will throw a NullReferenceException, the prompt is empty. And this error has only occurred in the project in the commercial group and Xinjiang oil, of which Xinjiang mail solves this problem by reinstalling Windows, but it is obviously not a good solution. The reason for this problem has not been found, and the initial determination is generated after the MDAC version is upgraded.
The better solution currently can think is: fill the value in the Recordset interface to the DataSet, such as:
Adapter.Fill (DS, RS, "Message); where Adapter is OLEDBDataAdapter.
This will be able to read data correctly.
It should be paid to it in the future, and the old Recordset operation data cannot be used directly, and it is best to put direct database operations into COM .