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

ADOQuery problem when adding SQL Command

Status
Not open for further replies.

tjessy

Programmer
Feb 12, 2004
1
HU
hi,

i get an error message when i trying to add the SELECT line
with SUM(), or COUNT() to ADOQuery.SQL...

the code looks like this:

..
ADOQuery.SQL.CLEAR;
ADOQuery.SQL.Add('SELECT XY.XY, SUM(XY,XY)'); --> this causes an exception: Access violation in module msjet40.dll,

but if i remove SUM(XY,XY), it works fine.
(of course i've included GROUP BY at the end of the statement)

My question is, how can i use SUM(), or COUNT() with ADOQuery or ADOTable?
 
Am not very sure but

You want to select range and then add

ADOQuery.SQL.Add('SELECT XY.XY, SUM(XY,XY)');

if so You must make sure that the values exists in the datasource,

If they are then I dont know what causes that
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top