在程序中,VC6.0为了节省资源不会自动加载float类,如果要给float类型用scanf赋值,需要在其后或其前显示的调用float类
进行运算或处理来自动加载float类。
在VC6.0中打开RTTI特性,project->setting->C/C++->catagory->C++ language->钩选RTTI
#include <windows.h>
#include <sqlext.h>
#include <stdio.h>
#ifdef _MSC_VER
#pragma comment(lib,"odbc32.lib")
#define SQLLEN SQLINTEGER
#endif
enum errtype { ERRORFREE, ERRACTION, XLSBUSY, TXTBUSY, TXTOPENERROR,
SQLHANDLEENVERROR, SQLSETENVERROR, SQLHANDLEDBCERROR,
SQLCONNECTERROR, SQLALLOCSTMTERROR, SQLCREATEERROR,
SQLSELECTERROR, SQLBINDERROR } ;
SQLHENV henv;
SQLHDBC hdbc;
SQLHSTMT hstmt;
// ------------------------------------------------------------------------------------------------------------
static void dbError( LPSTR lp, SQLSMALLINT handleType, SQLHANDLE handle)
{
BYTE buf[250], sqlstate[15];
SQLGetDiagRec( handleType,handle, 1, sqlstate, NULL,buf, sizeof(buf),NULL);
fprintf(stderr, "%s: %s SQLSTATE=%s/n",lp, buf, sqlstate);
}
// ------------------------------------------------------------------------------------------------------------
static void dbCleanup()
{
if (hstmt != SQL_NULL_HANDLE) {
SQLFreeStmt(hstmt, SQL_UNBIND);
SQLFreeHandle(SQL_HANDLE_STMT,hstmt);
}
if (hdbc != SQL_NULL_HANDLE) {
SQLDisconnect(hdbc);
SQLFreeHandle(SQL_HANDLE_DBC,hdbc);
}
if (henv != SQL_NULL_HANDLE) SQLFreeHandle(SQL_HA