Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLQUERY gives me an error!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello you all,

I'm using DBEXPRESS components, and when i use sqlquery
it gives me an error. Here's some code:

sqlquery1.close;
sqlquery1.sql.clear;
sqlquery1.sql.add ('SELECT * FROM TABLE1');
sqlquery1.open;

Here's the error:
SQLQUERY1: Cursor not returned from query

Did you have any solution to solve this error?

If I use, the code I will show to you, I don't receive
that error.

Here's the code:

sqlclientdataset1.close;
sqlclientdataset1.commandtext:='SELECT * FROM TABLE1';
sqlclientdataset1.open;

Regards,
SolveProblems
 
Does your table in the Database has the name TABLE1?.
SQL queries are run against a real table not a non visual component. S. van Els
SAvanEls@cq-link.sr
 
Don't work.

I try:

sqlquery1.close;
sqlquery1.sql.clear;
sqlquery1.sql.add ('SELECT * FROM mytable');
sqlquery1.open;

 
Are you setting the table name to a variable? If you are then try this:

SQLQuery.SQL.Add( 'Select * From ' + oSysOptions.DatabaseName );

oSysOptions.DatabaseName is the variable name I use to store the table name for use throughout my programs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top