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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

undeclared identifier: 'ctquery'

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
See thread102-1412613

I have exactly the same problem as in thread102-1412613, where whosrdaddy responded to add DB in units list. Another poster said that worked, but I don't have the experience to know what it means to add DB in units list.

whosrdaddy, I'd appreciate a fuller explanation please?

Thanks,

Jim
... absent from Tek-Tips for a few years!
 
Hi,

ctquery is defined in DB.pas:

Code:
...
  TPSCommandType = (ctUnknown, ctQuery, ctTable, ctStoredProc, ctSelect,
    ctInsert, ctUpdate, ctDelete, ctDDL);
  TSQLCommandType = ctQuery..ctStoredProc;
...

you are saying you have the same problem. Can you show some codee (along with the compiler error you are getting?)

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Here is the exact code from an example I am trying.
P.S I am using Delphi 7

Code:
procedure TfrmAcquisition.FormShow(Sender: TObject);
begin
  dmoLibrary.cdsBook.Close;   //close before making changes
  //setting up the SQLDataSet as a query
  dmoLibrary.sdsBook.CommandType := ctQuery;
  dmoLibrary.sdsBook.CommandText :=
                                'SELECT * from librarybook ORDER BY BookTitle';
  dmoLibrary.cdsBook.Open;
  dmoLibrary.cdsAquisition.Open;
  dmoLibrary.cdsBook.Refresh;

end;

Error..

Code:
[Error] AcquisitionU.pas(58): Undeclared identifier: 'ctQuery'

Thanks for any help you can give me.
 
PS to the above....

In the unit for the data module, DB is already listed under USES. Is putting DB into uses what you meant in your response in the other thread when you said add DB to units list?- or is units list something else again?

(I'm new to Delphi btw, used to be quite well versed in VB up to VB6)
 
SOLVED... had missed a small step in the manual I'm using, needed to add the namespace sqlexpr.

I don't know how many millions of times I've told people to read the freakin' manual properly over the years, just goes to show hehe.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top