Ха, получилось вроде.
То есть оно работает :)
#include once "sqlite3.bi"
#define NULL Cast(Any Ptr,0)
dim as sqlite3 ptr db
dim as zstring ptr errMsg
dim as string database_name
Dim error_ As Integer
Dim As sqlite3_stmt Ptr sql_stat
database_name="mybase.sqlite"
if sqlite3_open( database_name, @db ) then
print "Can't open database: "; *sqlite3_errmsg( db )
sqlite3_close( db )
end 1
end if
print "Using database: "; database_name
print
error_ = sqlite3_prepare(db,"SELECT result,count(*) FROM mytable GROUP BY result",-1,@sql_stat,NULL)
If (error_ <> SQLITE_OK) Then
print "Can't prepare database: "; *sqlite3_errmsg( db )
sqlite3_close( db )
end 1
End If
While (sqlite3_step(sql_stat) = SQLITE_ROW)
print "Columns = "; sqlite3_column_count(sql_stat)
print *sqlite3_column_name(sql_stat,0), *sqlite3_column_text(sql_stat,0)
print *sqlite3_column_name(sql_stat,1), *sqlite3_column_text(sql_stat,1)
Wend
sqlite3_finalize(sql_stat)
sqlite3_close(db)