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. Database & SysAdmin
  3. Database
  4. A connection to Sqlce using c++ for a smart device using ADO

A connection to Sqlce using c++ for a smart device using ADO

Scheduled Pinned Locked Moved Database
databasecsharphelptutorialc++
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.
  • K Offline
    K Offline
    kingori
    wrote on last edited by
    #1

    Hi and thank you in advance. As i write this, I have tried to research the internet on database applications for devises running windows mobile or windows CE and to my surprise most examples I find, even msdn itself concentrates on C#.net and VB.net I have been looking for an example on how to do a database a c++ program connecting to sqlce database (.sdf) using ado.net I use VS 2010. I have done the following so far. Have added a common file I found - Ado.h I have installed sql server ce on my emulator, I am using Windows mobile 5.0. I have the following code in my InitInstance() function CDatabase g_db; m_strConnection = _T("Data Source=\\My Documents\\DB2.sdf"); if(!g_db.Open(m_strConnection)) { AfxMessageBox(_T("Cannot open database")); //return FALSE; } when i deploy the emulator, this is the error i get, "A problem has occured... please report this to microsoft". Meaning my program crushes and cannot open the DB. the DB2.sdf is saved in the My documents of the emulator. Please assist, I need to know how to successfully connect to the DM. Accept my thanks in advance

    H 1 Reply Last reply
    0
    • K kingori

      Hi and thank you in advance. As i write this, I have tried to research the internet on database applications for devises running windows mobile or windows CE and to my surprise most examples I find, even msdn itself concentrates on C#.net and VB.net I have been looking for an example on how to do a database a c++ program connecting to sqlce database (.sdf) using ado.net I use VS 2010. I have done the following so far. Have added a common file I found - Ado.h I have installed sql server ce on my emulator, I am using Windows mobile 5.0. I have the following code in my InitInstance() function CDatabase g_db; m_strConnection = _T("Data Source=\\My Documents\\DB2.sdf"); if(!g_db.Open(m_strConnection)) { AfxMessageBox(_T("Cannot open database")); //return FALSE; } when i deploy the emulator, this is the error i get, "A problem has occured... please report this to microsoft". Meaning my program crushes and cannot open the DB. the DB2.sdf is saved in the My documents of the emulator. Please assist, I need to know how to successfully connect to the DM. Accept my thanks in advance

      H Offline
      H Offline
      hairy_hats
      wrote on last edited by
      #2

      I think you can only access SQLCE from .NET. MS imply that access from C++ is either impossible or nearly so.

      K 1 Reply Last reply
      0
      • H hairy_hats

        I think you can only access SQLCE from .NET. MS imply that access from C++ is either impossible or nearly so.

        K Offline
        K Offline
        kingori
        wrote on last edited by
        #3

        Hi, so what database can I use with c++, they must have put MFC Smart Device applications development with a reason. Does pocket access work (.cdb)

        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