Board index » delphi » SQL error - cursor error

SQL error - cursor error

  qTables.Close;
  qTables.SQL.Clear;
  qTables.SQL.Add('UPDATE SYSTBLD SET DONE = FALSE');
  qTables.Prepare;
  qTables.Open;
  qTables.Close;

This gives me a NoResultSet error of "Error creating cursor error".  What
didn't I do?  The statement works in the database explorer.

Thanks,

--
Craig
Programming by C

 

Re:SQL error - cursor error


Hi Craig,

You need to use qTables.ExecSQL rather than qTables.Open

Cheers,
Carl.

Quote
Craig Clemans wrote:

>   qTables.Close;
>   qTables.SQL.Clear;
>   qTables.SQL.Add('UPDATE SYSTBLD SET DONE = FALSE');
>   qTables.Prepare;
>   qTables.Open;
>   qTables.Close;

> This gives me a NoResultSet error of "Error creating cursor error".  What
> didn't I do?  The statement works in the database explorer.

> Thanks,

> --
> Craig
> Programming by C

--
Please remove 'no__junk' from the return address to Email me.

Re:SQL error - cursor error


Thanks, that did the job.  What dictates when to use ExecSQL or Open?

Quote

> You need to use qTables.ExecSQL rather than qTables.Open

--
Craig
Programming by C

Re:SQL error - cursor error


Use Open when the query returns a dataset and ExecSQL when the query is
used to alter a table.

Quote
Craig Clemans wrote:

> Thanks, that did the job.  What dictates when to use ExecSQL or Open?

---8<---

--
Please remove 'no__junk' from the return address to Email me.

Other Threads