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!

CDatabase

Status
Not open for further replies.

jl3574

Programmer
Jun 5, 2003
76
CA
i created a Cdatabase object linked to ms sql server
i excute sql command by
CDatabase* newDB = new CDatabase
newDB->excuteSQL(" sql statment");

now i want to remove all the rows from my table
i tried using
newDB->excuteSQL("truncate table tablename");
this does not work but this compiles but when i run it pop up a box with and (x) but no error statement;

i have no idea whats wrong? do i have to use a Crecordset object instead of CDatabase? i have both Crecordset and Cdatabase in my program i use CDatabase to insert into database and i use Crecordset to retrieve data. i'm not sure what i'm doing wrong?
or is my sql statment wrong? any sugguestions?
thx
 
truncate table tablename

So that statment works when you execute it in your database environment? Using the same account? Are you catching exceptions?

-pete
 
using the same account that statments works and compiles in my application, i'm not what u mean by 'catching exception'?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top