bool CppSQLite3DB::tableExists(LPCTSTR szTable) { TCHAR szSQL[128]; _stprintf(szSQL, _T("select count(*) from sqlite_master where type='table' and name='%s'"), szTable); int nRet = execScalar(szSQL); return (nRet > 0); }
bool CppSQLite3DB::tableExists(const char* szTable) { char szSQL[256]; sprintf_s(szSQL,"select count(*) from sqlite_master where type='table' and name='%s'", szTable); int nRet = execScalar(szSQL); return (nRet > 0); }
bool CppSQLite3DB::viewExists(const char* szView) { char szSQL[256]; sprintf(szSQL, "select count(*) from sqlite_master where type='view' and name='%s'", szView); int nRet = execScalar(szSQL); return (nRet > 0); }
int CppSQLite3DB::execScalarEx(LPCTSTR szSQL,...) { CString csText; va_list vlist; ASSERT(AfxIsValidString(szSQL)); va_start(vlist, szSQL); csText.FormatV(szSQL,vlist); va_end(vlist); return execScalar(csText); }
bool CppSQLite3DB::tableExists(const char* szTable) { char szSQL[256]; #if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) sprintf_s( szSQL , 256 , "select count(*) from sqlite_master where type='table' and name='%s'" , szTable); #else sprintf( szSQL , "select count(*) from sqlite_master where type='table' and name='%s'" , szTable); #endif int nRet = execScalar(szSQL); return (nRet > 0); }
bool CppSQLite3DB::tableExists(const CString& strTable) { CString strSQL = WizFormatString1(_T("select count(*) from sqlite_master where type='table' and name='%1'"), strTable); int nRet = execScalar(strSQL); return (nRet > 0); }