Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Connecting application with SQL CE 2.0 DB

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-03-12 : 09:23:06
Sasikumar writes "Dear All,
Im new to SQL CE 2.0 version.
We decided to go with MS SQL CE for the DB development for our Project which should work in the Hand Held Terminal devices.
We have developed our application using C++ in eVc++ environment ( CE 3.0) and from this application only we need to connect to the SQL CE DB and to manipulate the data.
So we need some guidance or some sample applications on how we could achieve the above mentioned. We searched in the Net and could not find any data.
We need to know how to establish a connection to the DB using the application.
Using that connection reference we need to access tables etc,
Also while searching we obtained some links
We used the sample code available in the MSDN link

http://msdn2.microsoft.com/en-us/library/aa237914(SQL.80).aspx

But when we compiled we were able to compile without any errors after including the necessary header and library files.
When we tried to execute the program we were facing some problem with the following line

hr = CoCreateInstance( CLSID_SQLSERVERCE_2_0, 0, CLSCTX_INPROC_SERVER,IID_IDBDataSourceAdmin, (void**)& pIDBDataSourceAdmin);


Here the hr values gets filled with some negative value -2147221164


We are using SQL CE 2.0

EVC 3.0

PocketPC emulator

Kindly help us out in this issue

Regards
Sasi"
   

- Advertisement -