In vc ++ and MFC, when an SQL server statement is executed using ado and the true and false values of the returned values are determined, that is, the bool type, adobool
In mfc vc ++, You can query tables in the database to determine whether the SQL statement is successfully executed.
If the bool value is true (1), if the failure is returned, the bool value is false (0 ).
The simple bool type code is as follows:
CString SQL, Result; SQL. format (_ T ("select * from [dbo]. [% s] "), Name); // Name is the Name of the table in the database BOOL bool_temp = TheAdoData. executeSQL (_ bstr_t) SQL); // determines whether the previous SQL statement is successfully executed. If yes, true (1) is returned. If no, false (0) Result is returned. format ("% d", bool_temp); if (Result = '0') {MessageBox ("This table is not found in this database ");} else {MessageBox ("This table exists in this database ");}
===================================================== Welcome to raise a BUG ============ ==================================