[VSDK] Advice
Ruslan Zasukhin
sunshine at public.kherson.ua
Wed Oct 1 10:18:20 CDT 2003
on 9/29/03 3:09 PM, Srinivas Yalamarti at syalamar at fiberlink.com wrote:
Even better:
Instead of
---------------------------------------------
try{
pCursor = new VDK_Cursor(m_pfsdDatabase);
// VDK expects single-byte char string
char strSQL[MAX_PATH + 256];
sprintf(strSQL, "SELECT * FROM FILE_SYSTEM WHERE FILE_NAME = '%s'",
pchFileName);
ulong ulErr = pCursor->ExecuteSQL(strSQL);
if (ulErr)
{
if (pCursor)
{
delete pCursor; pCursor = NULL;
}
return false;
}
catch()
{
}
You can write shorter:
---------------------------------------------
try{
// VDK expects single-byte char string
char strSQL[MAX_PATH + 256];
sprintf(strSQL, "SELECT * FROM FILE_SYSTEM WHERE FILE_NAME = '%s'",
pchFileName);
pCursor = m_pfsdDatabase->SqlSelect(strSQL);
catch()
{
}
Because db.SqlSelect() throw errors.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list