Valentina Client 2.0 - C++
David Nock
davidn at accessitsoftware.com
Tue Mar 9 11:52:42 CST 2004
> Better use the next form:
>
> bool MyFrame::RunQuery(wxString szQuery)
> {
> VDK_Cursor* mCursor;
> ulong err = 0;
>
> try
> {
> char* query = "CREATE TABLE _Preferences(fldBoolean boolean)"
> mCursor = mDB->ExecuteSql( query );
> }
> catch( FBL_Exception& e )
> {
> err = e.GetErrorCode();
> wxMessageBox("Error executing SQL.");
> }
>
> ForgetObject( mCursor );
> return (err == 0);
> }
>
Hi Ruslan,
I tried this but it doesn't compile as ExecuteSQL isn't a member of
VDK_Database.
Anyway I changed it to:
bool MyFrame::RunQuery(wxString szQuery)
{
VDK_Cursor* mCursor;
ulong err = 0;
mCursor = new VDK_Cursor(myDB);
try
{
const char* query = "CREATE TABLE _Preferences(fldBoolean boolean)"
err = mCursor->ExecuteSQL( query );
}
catch( xFBL_Exception& e )
{
err = e.GetErrorCode();
wxMessageBox(wxString::Format("Error executing SQL - [%ld]", err));
}
ForgetObject( mCursor );
return (err == 0);
}
This is into a pre-existing database. I also now have the server running
from the dos prompt to see the debug info.
The error returned is 600 - 'Expected key word SELECT'. Why when creating a
table??
Also, in the debug info shown in the dos prompt, it shows as 2.0a59 but the
properties of the server.dll show as a60.
Cheers
Dave
**********************
David Nock
Senior Developer
Access-It Software Ltd
**********************
More information about the Valentina
mailing list