Board index » delphi » Error Creating Cursor Handle Error!

Error Creating Cursor Handle Error!

I have a TQuery in an app that I use to create tables and indexes via SQL.
When I create a table using standard sql:

create table foo
(
    bar varchar(20),
    bar_none char(1)
)

I get the above mentioned error.  The table is created normally and I don't
want a cursor on the table.  How can I surpress this error.
Quick thought now:    Could it be because the TQuery is connected to a
DataSource which is connected to a grid therefore trying to display the
resulting table....

Jeremy

 

Re:Error Creating Cursor Handle Error!


Instead of setting TQuery.Active = True or TQuery.Open, use
TQuery.ExecSQL. As your SQL syntax doesn't return a result set, this may be the
cause of your error.

Quote
Jeremy wrote:
> I have a TQuery in an app that I use to create tables and indexes via SQL.
> When I create a table using standard sql:

> create table foo
> (
>     bar varchar(20),
>     bar_none char(1)
> )

> I get the above mentioned error.  The table is created normally and I don't
> want a cursor on the table.  How can I surpress this error.
> Quick thought now:    Could it be because the TQuery is connected to a
> DataSource which is connected to a grid therefore trying to display the
> resulting table....

> Jeremy

Re:Error Creating Cursor Handle Error!


When you execute DDL statements you must use TQuery.ExecSQL so the BDE will
not try to open a cursor.

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Other Threads