本文整理汇总了C++中CppSQLite3Query::eof方法的典型用法代码示例。如果您正苦于以下问题:C++ CppSQLite3Query::eof方法的具体用法?C++ CppSQLite3Query::eof怎么用?C++ CppSQLite3Query::eof使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CppSQLite3Query
的用法示例。
在下文中一共展示了CppSQLite3Query::eof方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAllVisiter
void GetAllVisiter(int64 ParentID, vector<int64>& VisiterList,int64 NotIncludeChildID/*=0*/){
char TableName[30];
int64toa(ParentID,TableName);
if(!GetWorldDB().tableExists(TableName)){
return ;
}
CppSQLite3Buffer SQL;
SQL.format("select %s from \"%s\" where %s>%d",
ITEM_ID,
TableName,
ITEM_TYPE,
OBJECT_SPACE
);
CppSQLite3Query Result = GetWorldDB().execQuery(SQL);
if(Result.eof())return ;
while(!Result.eof()){
int64 ChildID = Result.getInt64Field(0);
if (ChildID != NotIncludeChildID)
{
VisiterList.push_back(ChildID);
}
Result.nextRow();
}
}
示例2: OnSelchangeLocationlist
void CTerminateNewLocationDialog::OnSelchangeLocationlist()
{
int iLocationID = m_ctlLocationList.GetItemData(m_ctlLocationList.GetCurSel());
CString sSQL;
sSQL.Format("SELECT Industries.id,Industries.name FROM Industries,Sidings WHERE Industries.Sidings_FK=Sidings.id AND Sidings.Locations_FK=%d",iLocationID);
TRACE(sSQL);
//
CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB;
CppSQLite3Query q = pDB->execQuery(sSQL);
//
while( m_ctlIndustryList.GetCount() > 0 )
m_ctlIndustryList.DeleteString(0);
//
while (!q.eof())
{
int nIndex = m_ctlIndustryList.AddString(q.getStringField("name"));
m_ctlIndustryList.SetItemData(nIndex,q.getIntField("id"));
q.nextRow();
}
//
sSQL.Format("SELECT id,name FROM Sidings WHERE Locations_FK=%d;",iLocationID);
q = pDB->execQuery(sSQL);
//
while( m_ctlSidingList.GetCount() > 0 )
m_ctlSidingList.DeleteString(0);
//
while (!q.eof())
{
int nIndex = m_ctlSidingList.AddString(q.getStringField("name"));
m_ctlSidingList.SetItemData(nIndex,q.getIntField("id"));
q.nextRow();
}
q.finalize();
}
示例3: GetGrupos
//Método que monta as tab do Tab Control
void CRcGen::GetGrupos(WPARAM wParam, CStringArray& arrayGrp)
{
CStringA sQuery;
sQuery.Format("select distinct res.grupo, resgrupo.descricao from res, resgrupo where res.grupo = resgrupo.grupo and res.pagina between %d and %d", LOWORD(wParam), HIWORD(wParam));
try
{
CppSQLite3Query q = CppSQLite3DB::getInstance()->execQuery(sQuery);
if(!q.eof())
{
m_nGrupo = q.getIntField(0);
m_nGrupoInicial = m_nGrupo;
}
while(!q.eof())
{
arrayGrp.Add(CString(q.getStringField(1)));
q.nextRow();
}
}
catch(CppSQLite3Exception e)
{
}
}
示例4: GetTypeFlags
long CDittoRulerRichEditCtrl::GetTypeFlags(long lID)
{
long lRet = stNONE;
try
{
CLIPFORMAT cfType = CF_TEXT;
CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT lID FROM Data WHERE lParentID = %d AND strClipboardFormat = '%s'"), lID, GetFormatName(cfType));
if(q.eof() == false)
{
lRet |= stCF_TEXT;
}
cfType = CF_UNICODETEXT;
q = theApp.m_db.execQueryEx(_T("SELECT lID FROM Data WHERE lParentID = %d AND strClipboardFormat = '%s'"), lID, GetFormatName(cfType));
if(q.eof() == false)
{
lRet |= stCF_UNICODETEXT;
}
cfType = RegisterClipboardFormat(_T("Rich Text Format"));
q = theApp.m_db.execQueryEx(_T("SELECT lID FROM Data WHERE lParentID = %d AND strClipboardFormat = '%s'"), lID, GetFormatName(cfType));
if(q.eof() == false)
{
lRet |= stRTF;
}
}
CATCH_SQLITE_EXCEPTION
return lRet;
}
示例5: OnOK
void CCarTypesDetailDialog::OnOK()
{
// TODO: Add extra validation here
UpdateData();
//
CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB;
CString sSQL;
//
// add?
//
if( m_iCarTypeFK == -1 )
{
sSQL.Format("SELECT 1 FROM CarTypes WHERE type_id=\"%s\"",m_sCarTypeID);
CppSQLite3Query q = pDB->execQuery((LPCTSTR)sSQL);
//
if(!q.eof())
{
MessageBox("Duplcate Type ID!","LSC TrainOps Error",MB_ICONSTOP|MB_OK);
return;
}
sSQL.Format("INSERT INTO CarTypes (id,type_id,description,active,passenger) VALUES (NULL,\"%s\",\"%s\",1,%d)",m_sCarTypeID,m_sCarTypeDescription,m_bPassenger?1:0);
}
else
{
sSQL.Format("UPDATE CarTypes SET type_id=\"%s\",description=\"%s\",passenger=%d WHERE id=%d",m_sCarTypeID,m_sCarTypeDescription,m_bPassenger?1:0,m_iCarTypeFK);
}
pDB->execDML((LPCTSTR)sSQL);
CDialog::OnOK();
}
示例6: PutClipOnDittoCopyBuffer
bool CDittoCopyBuffer::PutClipOnDittoCopyBuffer(long lClipId, long lBuffer)
{
try
{
//enclose in brackets so the query closes before we update below
{
CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT lID FROM CopyBuffers WHERE lCopyBuffer = %d"), lBuffer);
if(q.eof())
{
theApp.m_db.execDMLEx(_T("INSERT INTO CopyBuffers VALUES(NULL, -1, %d);"), lBuffer);
}
}
theApp.m_db.execDMLEx(_T("UPDATE CopyBuffers SET lClipID = %d WHERE lCopyBuffer = %d"), lClipId, lBuffer);
CCopyBufferItem Item;
g_Opt.GetCopyBufferItem(lBuffer, Item);
if(Item.m_bPlaySoundOnCopy)
{
PlaySound(_T("ding.wav"), NULL, SND_FILENAME|SND_ASYNC);
}
return true;
}
CATCH_SQLITE_EXCEPTION
return false;
}
示例7: GetClipData
BOOL CCP_MainApp::GetClipData(long lID, CClipFormat &Clip)
{
BOOL bRet = FALSE;
try
{
CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT ooData FROM Data WHERE lParentID = %d AND strClipboardFormat = '%s'"), lID, GetFormatName(Clip.m_cfType));
if(q.eof() == false)
{
int nDataLen = 0;
const unsigned char *cData = q.getBlobField(_T("ooData"), nDataLen);
if(cData != NULL)
{
Clip.m_hgData = NewGlobal(nDataLen);
::CopyToGlobalHP(Clip.m_hgData, (LPVOID)cData, nDataLen);
bRet = TRUE;
}
}
}
CATCH_SQLITE_EXCEPTION
return bRet;
}
示例8: CreateInfoByid
char* CreateInfoByid(int id)
{
static char buffer[1024]={0};
static char querybuf[1024]={0};
char* str = "%s 体力%s 武力%s 智力%s 魅力%s 年龄%s 类型 %s";
memset(querybuf,0,1024);
try
{ db.open("database/infodata.db");
sprintf(querybuf,"select heroinfo.name,ti,wu,zhi,mei,age,herotype.name from "
" heroinfo,herotype where heroinfo.id=%d and heroinfo.type=herotype.id;",id);
CppSQLite3Query q = db.execQuery(querybuf);
//nge_charsets_utf8_to_gbk((uint8*)str, (uint8*)querybuf, strlen(str), 1024);
if (!q.eof())
{
sprintf(buffer,str, q.fieldValue(0),q.fieldValue(1),q.fieldValue(2),q.fieldValue(3),
q.fieldValue(4),q.fieldValue(5),q.fieldValue(6));
}
db.close();
}catch (CppSQLite3Exception& e){
printf("%s\n",e.errorMessage());
}
return buffer;
}
示例9: in
BOOL FireFox3PlugIn::ExportFavoriteData( PFAVORITELINEDATA* ppData, int32& nDataNum )
{
memset(ppData,0x0, nDataNum*sizeof(PFAVORITELINEDATA));
if (ppData == NULL || *ppData == NULL || nDataNum == 0)
{
return FALSE;
}
string strSql = "select marks.* from moz_bookmarks as marks where marks.id in (2,3,4,5)";
CppSQLite3Query Query = m_pSqliteDatabase->execQuery(strSql.c_str());
// 当前插入的位置
int nCurrentIndex = 0;
while(!Query.eof())
{
int nId = Query.getIntField("id", 0);
ExportFavoriteData(nId,ppData,nCurrentIndex);
Query.nextRow();
}
nDataNum = nCurrentIndex;
return TRUE;
}
示例10: loadItemsData
//private
void RPGMapItemsMenuLayer::loadItemsData()
{
//道具数据
this->m_itemsList->removeAllObjects();
CppSQLite3Query query = this->m_db->execQuery(ITEMS_EXISTING_QUERY);
while(!query.eof())
{
RPGExistingItems *itemsData = RPGExistingItems::create();
itemsData->m_dataId = query.getIntField("id");
itemsData->m_name = query.getStringField("name_cns");
itemsData->m_buy = query.getIntField("buy");
itemsData->m_sell = query.getIntField("sell");
itemsData->m_type = query.getIntField("type");
itemsData->m_attack = query.getFloatField("attack");
itemsData->m_defense = query.getFloatField("defense");
itemsData->m_speed = query.getFloatField("speed");
itemsData->m_skillAttack = query.getFloatField("skill_attack");
itemsData->m_skillDefense = query.getFloatField("skill_defense");
itemsData->m_total = query.getIntField("total");
this->m_itemsList->addObject(itemsData);
query.nextRow();
}
query.finalize();
CCTableView *tableView = (CCTableView*)this->getChildByTag(kRPGMapItemsMenuLayerTagItemListTable);
tableView->reloadData();
}
示例11: SQLToBizUserDataArray
bool CWizIndexBase::SQLToBizUserDataArray(const QString& strSQL,
CWizBizUserDataArray& arrayUser)
{
try
{
CppSQLite3Query query = m_db.execQuery(strSQL);
while (!query.eof())
{
WIZBIZUSER data;
data.bizGUID = query.getStringField(userBIZ_GUID);
data.userId = query.getStringField(userUSER_ID);
data.userGUID = query.getStringField(userUSER_GUID);
data.alias = query.getStringField(userUSER_ALIAS);
data.pinyin = query.getStringField(userUSER_PINYIN);
arrayUser.push_back(data);
query.nextRow();
}
return true;
}
catch (const CppSQLite3Exception& e)
{
return LogSQLException(e, strSQL);
}
}
示例12: SQLToDocumentAttachmentDataArray
bool CWizIndexBase::SQLToDocumentAttachmentDataArray(const CString& strSQL,
CWizDocumentAttachmentDataArray& arrayAttachment)
{
try
{
CppSQLite3Query query = m_db.execQuery(strSQL);
while (!query.eof())
{
WIZDOCUMENTATTACHMENTDATA data;
data.strKbGUID = kbGUID();
data.strGUID = query.getStringField(documentattachmentATTACHMENT_GUID);
data.strDocumentGUID = query.getStringField(documentattachmentDOCUMENT_GUID);
data.strName = query.getStringField(documentattachmentATTACHMENT_NAME);
data.strURL = query.getStringField(documentattachmentATTACHMENT_URL);
data.strDescription = query.getStringField(documentattachmentATTACHMENT_DESCRIPTION);
data.tInfoModified = query.getTimeField(documentattachmentDT_INFO_MODIFIED);
data.strInfoMD5 = query.getStringField(documentattachmentATTACHMENT_INFO_MD5);
data.tDataModified = query.getTimeField(documentattachmentDT_DATA_MODIFIED);
data.strDataMD5 = query.getStringField(documentattachmentATTACHMENT_DATA_MD5);
data.nVersion = query.getInt64Field(documentattachmentVersion);
arrayAttachment.push_back(data);
query.nextRow();
}
std::sort(arrayAttachment.begin(), arrayAttachment.end());
return true;
}
catch (const CppSQLite3Exception& e)
{
return LogSQLException(e, strSQL);
}
}
示例13: SQLToStyleDataArray
bool CWizIndexBase::SQLToStyleDataArray(const CString& strSQL, CWizStyleDataArray& arrayStyle)
{
try
{
CppSQLite3Query query = m_db.execQuery(strSQL);
while (!query.eof())
{
WIZSTYLEDATA data;
data.strKbGUID = kbGUID();
data.strGUID = query.getStringField(styleSTYLE_GUID);
data.strName = query.getStringField(styleSTYLE_NAME);
data.strDescription = query.getStringField(styleSTYLE_DESCRIPTION);
data.crTextColor = query.getColorField(styleSTYLE_TEXT_COLOR);
data.crBackColor = query.getColorField(styleSTYLE_BACK_COLOR);
data.bTextBold = query.getBoolField(styleSTYLE_TEXT_BOLD);
data.nFlagIndex = query.getIntField(styleSTYLE_FLAG_INDEX);
data.tModified = query.getTimeField(styleDT_MODIFIED);
data.nVersion = query.getInt64Field(styleVersion);
arrayStyle.push_back(data);
query.nextRow();
}
std::sort(arrayStyle.begin(), arrayStyle.end());
return true;
}
catch (const CppSQLite3Exception& e)
{
return LogSQLException(e, strSQL);
}
}
示例14: SQLToTagDataArray
bool CWizIndexBase::SQLToTagDataArray(const CString& strSQL, CWizTagDataArray& arrayTag)
{
try
{
CppSQLite3Query query = m_db.execQuery(strSQL);
while (!query.eof())
{
WIZTAGDATA data;
data.strKbGUID = kbGUID();
data.strGUID = query.getStringField(tagTAG_GUID);
data.strParentGUID = query.getStringField(tagTAG_GROUP_GUID);
data.strName = query.getStringField(tagTAG_NAME);
data.strDescription = query.getStringField(tagTAG_DESCRIPTION);
data.tModified = query.getTimeField(tagDT_MODIFIED);
data.nVersion = query.getInt64Field(tagVersion);
arrayTag.push_back(data);
query.nextRow();
}
std::sort(arrayTag.begin(), arrayTag.end());
return true;
}
catch (const CppSQLite3Exception& e)
{
return LogSQLException(e, strSQL);
}
}
示例15: getcache
bool mtn_cms_page_builder::getcache(const std::string& page, mtn_cms_cache_item* cache_item)
{
std::string _q = "SELECT * FROM `page_cache` WHERE page = \'" + page + "\';";
try
{
CppSQLite3Query q = _db->execQuery(_q.c_str());
while (!q.eof())
{
int len;
cache_item->data = q.getStringField("data");
cache_item->created = q.getIntField("created");
cache_item->ttl = q.getIntField("ttl");
cache_item->valid = true;
q.nextRow();
}
}
catch (CppSQLite3Exception ex)
{
cache_item->valid = false;
}
return cache_item->valid;
}