Use custom class CSetoDBC (2)

zhaozj2021-02-16  72

He Zhidan

1. Use the SQL word sentence to use any database, use SQL as an example. Body.clientHeight) this.width = body.clientHeight "src =" http://www.338888.com/vcshare/images/upfile/200461521239. JPG "onMousewheel =" Return Yuzi_img (Event, this) "> 2 "); const cstring strconnect = DLG.GetConnectStr (); // Get the connection string CString strsql; cdatabase db; db.openex (strconnect); // Open the database {// Add record strsql =" Insert Into Character (Name, Country , AGE) VALUES (/ 'HE /', / 'China /', 24) "; db.executesql (strsql);} {// Delete Record strsql.format (" Delete from Character Where Age =% D ", 24 ); db.executesql (strsql);} {// modified record strsql.format ("Update Character Set Age = 25 Where Name = / 'HE /'" :db.executesql(STRSQL );} // Show all records {CSTRING STROUTPUT; CRECORDSET RS (& DB); rs.open (CRecordset :: Snapshot, "Select * from Character"); int nfield = rs.getodbcfieldcount (); while (! Rs.iseof ()) {for (int I = 0; I

转载请注明原文地址:https://www.9cbs.com/read-21673.html

New Post(0)