He Zhidan
1. Theoretically support any database, as an example of Acess, the structure is shown in Body.ClientHeight) this.width = body.clientHeight "src =" http://www.33888.com/vcshare/images/upfile/200461521236.jpg "OnMouseWheel =" Return Yuzi_IMG (Event, this) "> 2, related information records in the INI or registry, its structure is: [Data Source] DSN = TestodBCUID = adminPwd = 3, dynamically bind a class, change getDefaultconnectcstring ccharacterset :: getDefaultConnect () {csetoDBC DLG; cstract strconnect = "odbc;" DLG.getConnectStr (); returnnect); // Dynamically get ODBC // Return_T ("ODBC; DSN = Testodbc");} 4 , Use void ctestodbcdlg :: onRecordset () {ccharacterset {csetoDBC DLG; rs.open (DLG.GetWriteDBStyle ()); {// increase record rs.addNew (); rsm_name = "r典"; rm r. = 60; rs.m_country = "Wei"; rs.Update ();} {// Modify Record rmovefirst (); while (! Rs.iseof ()) {IF ("r韦 == rs.m_name ) {r.EDit (); rs.m_age = 59; rs.Update ();}}}} {// Remove}} {// Removal}}} {// Delete Record}}} {// Delete Record}}} {// Remove Rs.MoveFirst (); while (! rs.iseof ()) { IF ("Cai Wei" == r.m_name) {r.delete (); rs.ReQuery ();}}}} {// Display all record}} {// Display all record rsmovefirst (); cstring stroutPut; While (! rs.iseof ()) {CSTRING STRECORD; rs.m_name.trimleft (); rs.m_name.trimright (); rs.m_country.trimleft (); rs.m_count Ry.trimright (); strrecord.format ("name =% s / tcountry =% s / TAGE =% d /n" ,rs.m_name ,rs.m_country ,rs.m_age );stroutput = strrecord; rs.movenext (); AfxMessageBox (stroutput);} rs.close ();