newer answer
http://www.sqlapi.com/ This library might do what you want it to.
old answer
Basically you will have to iterate the columns with sqlite3_column_name16
or sqlite3_column_name
. You will have to compare the strings these return with the one you want to look up.
I have used this, its MFC, but it gives you the basic idea of what needs done.
int CSQLite3Query::FieldIndex(const CString &field)
{
CheckVM();
if ( !field.IsEmpty() )
{
for ( int nField = 0; nField < m_nCols; nField++ )
{
#ifdef UNICODE
CString sTemp = (LPCTSTR)sqlite3_column_name16(m_VM, nField);
#else
CString sTemp = (LPCTSTR)sqlite3_column_name(m_VM, nField);
#endif
if (sTemp == field)
return nField;
}
}
else
{
throw new CSQLite3Exception(MFCSQLITE3_ERROR,
MFCSQLITE3_INVALID_FIELD_NAME);
}
return -1;
}