查询数据库代码
//打开数据库查询数据
CString sDatabase;
CString sQuery;
CStringList slResults;
CString sResult;
sDatabase.Format(_T("%sData\\%s"), GetAppRoot(), SDDATABASE);
COdbcDatabase db;
if (db.InitializeWithPath(sDatabase))
{
sQuery.Format(
_T("SELECT [PropertyName], [DefinitionId], [PropertyType], [DefaultVaule], [AlternativeValue], [OnlyAlternative] FROM ")
_T("%s ") _T("WHERE [ID] = 1"),
TABLE_CUSTOMPROPERTY);
slResults.RemoveAll();
db.GetQuery(sQuery, slResults);
}