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. Data Source connection

Data Source connection

Scheduled Pinned Locked Moved C / C++ / MFC
databasesql-serversysadminquestion
3 Posts 3 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.
  • R Offline
    R Offline
    raju_shiva
    wrote on last edited by
    #1

    Hi sir, I have deleloped one dialog based application,where I will enter username and password and i have a created a button(Save). my plan is when i click the button i wnat it to save it in a database. I have created a database I have used this steps In SQL Server Enterprise MAnager I have created a new database as "Sample" and also created a new table there and two columns as "Name" and Password. Now i am not getting how can i connect to database I am totally struct and messing around,please give me any idea how can i process. Thanks Raj

    N S 2 Replies Last reply
    0
    • R raju_shiva

      Hi sir, I have deleloped one dialog based application,where I will enter username and password and i have a created a button(Save). my plan is when i click the button i wnat it to save it in a database. I have created a database I have used this steps In SQL Server Enterprise MAnager I have created a new database as "Sample" and also created a new table there and two columns as "Name" and Password. Now i am not getting how can i connect to database I am totally struct and messing around,please give me any idea how can i process. Thanks Raj

      N Offline
      N Offline
      Niklas L
      wrote on last edited by
      #2

      Have a look at ADO[^] API. There are some useful code snippets. Also, read about connection strings[^].

      home

      1 Reply Last reply
      0
      • R raju_shiva

        Hi sir, I have deleloped one dialog based application,where I will enter username and password and i have a created a button(Save). my plan is when i click the button i wnat it to save it in a database. I have created a database I have used this steps In SQL Server Enterprise MAnager I have created a new database as "Sample" and also created a new table there and two columns as "Name" and Password. Now i am not getting how can i connect to database I am totally struct and messing around,please give me any idea how can i process. Thanks Raj

        S Offline
        S Offline
        suzuuu
        wrote on last edited by
        #3

        if your's application is MFC based application, CDatabase class is there for manipulate database. If you wanna manipulate your database, you should make following steps.. 1. Build ODBC connection string for SQL server for this refer to connectionstring.com 2. Create object for CDatabase 3. Using CDatabase::Open() function get connection to your database 4. Using CDatabase::ExecteSQL() run your insert query.. 5. Finally close the connection CDatabase::Close().. -suzuu

        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