help me
-
someone can show me how to read and write record table (SQL DataBase) with VC++?? --code is better :) thanks Nho'c Ti`
:)To Write::: db.OpenEx("DSN=YOUR DSN;Uid=YOUR USER ID FOR SQL;Pwd=YOUR PASSWORD FOR SQL",CDatabase::noOdbcDialog) CString query="INSERT INTO Userinfo(Userid,Passw,Name,Address1,Address2,City,Country,Zip,Phone,Email,Pincode,Dateofentry) VALUES ('" + uid + "','" + pwd + "','" + uname + "','" + add1 + "','" + add2 + "','" + ucity + "','" + scountry + "','" + uzip + "','" + uphone + "','" + uemail + "','" + test + "',GetDate())"; db.ExecuteSQL (query); To Read:: CRecordset rs( &db ); CString check; check.Format ("SELECT Userid FROM Userinfo WHERE Pincode='" + test +"'"); rs. Open ( CRecordset::dynaset, check, CRecordset::none ) ; rs.GetFieldValue("your field",CString variable to store); after this you can convert it to integer or anythine..thats all..hope it helps.. cheers Himanshu