Dear All,
Im new to SQL CE 2.0 DB.
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 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

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);

hr gets updated with a negative value -2147221164

We are using SQL CE 2.0

EVC 3.0

PocketPC emulator