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!

wipe database table

Status
Not open for further replies.

AP81

Programmer
Apr 11, 2003
740
AU
Hi,

I am trying to wipe a table from a database then add new data to it again. It seems that if the SQL query doesn't return a result set, the program will throw an error. It still deletes all the data in the database, but throws an error.

I have tried:

delete from item_codes --> gives error 'command text does not return a result set' (works)

truncate table item_codes --> gives error 'command text does not return a result set' (works)

*note: both these work from the mySQL command line

ADOTableItemCodes.Open;
ADOTableItemCodes.Edit;
ADOTableItemCodes.Delete;
ADOTableItemCodes.Post; --> gives error 'command text does not return a result set' (works)

Is there a way to wipe a table from within the code? The database is mySQL by the way (not that it really matters)




------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
worked it out...

use ADOQuery.ExecSQL instead of ADOQuery.open.




------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top