Esempio n. 1
0
CSqlStatement::CSqlStatement(LPCTSTR statement, sqlite3* db)
{
   m_stmt = NULL;

   int rc = _sqlite3_prepare(db, statement, -1, &m_stmt, 0 );

   if (rc != SQLITE_OK)
   {
      m_stmt = NULL;
   }
}
Esempio n. 2
0
sqlite3_stmt* CppSQLite3DB::compile(LPCTSTR szSQL)
{	
	checkDB();
	sqlite3_stmt* pVM;

	int nRet = _sqlite3_prepare(mpDB, szSQL, -1, &pVM, NULL);

	if (nRet != SQLITE_OK)
	{
		pVM=NULL;
		LPCTSTR szError = (LPCTSTR) _sqlite3_errmsg(mpDB);
		throw CppSQLite3Exception(nRet, (LPTSTR)szError, DONT_DELETE_MSG);
	}
	return pVM;
}