A connection to Sqlce using c++ for a smart device using ADO
-
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 -
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 advanceI think you can only access SQLCE from .NET. MS imply that access from C++ is either impossible or nearly so.
-
I think you can only access SQLCE from .NET. MS imply that access from C++ is either impossible or nearly so.