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. CDatabase Open

CDatabase Open

Scheduled Pinned Locked Moved C / C++ / MFC
databasec++question
3 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.
  • M Offline
    M Offline
    MFC is the Best
    wrote on last edited by
    #1

    hello @all, i connected my mfc program and an access database with ODBC. CDatabase db; db.Open(_T( "MyDatabase" ), FALSE, FALSE, _T( "ODBC")); the ODBC driver of my database is called 'MyDatabase'. but when i use this code, the database is not selected. i must select it myself! what must i change to select my odbc driver from the program (i have to do nothing, after i start the program)? thanks mfc

    M 1 Reply Last reply
    0
    • M MFC is the Best

      hello @all, i connected my mfc program and an access database with ODBC. CDatabase db; db.Open(_T( "MyDatabase" ), FALSE, FALSE, _T( "ODBC")); the ODBC driver of my database is called 'MyDatabase'. but when i use this code, the database is not selected. i must select it myself! what must i change to select my odbc driver from the program (i have to do nothing, after i start the program)? thanks mfc

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      Is there a reason you are using ODBC and not ADO or even DAO? You'd probably find ADO more friendly and there are plenty of good classes on CP to make it even easier. Michael Fat bottomed girls You make the rockin' world go round -- Queen

      M 1 Reply Last reply
      0
      • M Michael P Butler

        Is there a reason you are using ODBC and not ADO or even DAO? You'd probably find ADO more friendly and there are plenty of good classes on CP to make it even easier. Michael Fat bottomed girls You make the rockin' world go round -- Queen

        M Offline
        M Offline
        MFC is the Best
        wrote on last edited by
        #3

        i ever use ODBC (i know, that is no argument :-D), i think it is better. but i found my mistake. i forgot: db.Open(_T( "MyDatabase" ),false, false, "ODBC;UID=sa"); thanks for your reply. :rose::rose: mfc

        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