Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. help me

help me

Scheduled Pinned Locked Moved C / C++ / MFC
databasec++helptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    don7cry
    wrote on last edited by
    #1

    someone can show me how to read and write record table (SQL DataBase) with VC++?? --code is better :) thanks Nho'c Ti`

    X 1 Reply Last reply
    0
    • D don7cry

      someone can show me how to read and write record table (SQL DataBase) with VC++?? --code is better :) thanks Nho'c Ti`

      X Offline
      X Offline
      xxhimanshu
      wrote on last edited by
      #2

      :)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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups