Re: SQLMobile Native OLE DB App Fails to Open database

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Tim,

Make sure you include the ssceoledb30.h file and use the new
CLSID_SQLSERVERCE_3_0 identifier to open the data source. This is one of the
very few changes I had to make in order to make all the code work with eVC4.
There is another one documented in my blog, concerning direct table access
using an index.

--
João Paulo Figueira
Embedded MVP
http://nativemobile.blogspot.com/

"Tim Brooks" <usna91@xxxxxxx> wrote in message
news:%23gkV$Va0FHA.1520@xxxxxxxxxxxxxxxxxxxxxxx
> And another follow-up. I was able to get the dll's to install. Seems to
> be a bug in the Cab deployment tool. I was adding the dll's to my Cab
> build project and then marking them for deployment to \Windows and
> self-register. The deployment kept failing saying that no registry create
> had been added. So, I unchecked self-register,
> rebuilt.....successfully....then deleted the cab file that had been
> created, went back and re-checked each for self-registration, hit the
> build button and voila, it suddenly was able to build. Then deployed to
> my PPC and fired up ISQLW and it was able to open my db.
>
> Sadly, getting back to my project, the Open() call -- see below -- is
> still failing. Returns the cryptic E_FAIL error. When I trace the Open()
> function as below, the base call to Open() is succeeding (HR = S_OK) but
> it nonetheless returns a failure message. I'm wondering if I'm supposed
> to be allocating something here on the heap vs the stack? Joao, I'm using
> the Open() function from your modified CDatasource example (atldbcli_ce).
> I'll keep working on it but I'm wondering there's something obvious I'm
> doing. I'll try to build your example from your CodeProject article
>
> http://www.codeproject.com/ce/atl_ole_db_ppc.asp
>
> .....and see what I might be doing differently.....but I really only used
> your example and am only trying to open a connection to my
> database...nothing else.....
>
> Thanks again....
>
>
>
> "João Paulo Figueira [eMVP]" <joao.figueira@xxxxxxxxxxxxxxxxxxxxxxxxx>
> wrote in message news:e0azdbX0FHA.3256@xxxxxxxxxxxxxxxxxxxxxxx
>> Maybe this helps:
>> http://nativemobile.blogspot.com/2005/10/installing-sql-mobile-beta-2.html
>>
>> Check is isqlw30.exe runs against your database. This application is an
>> OLE DB consumer. If it doesn't run, it means your OLE DB data provider is
>> not registered and the above link applies.
>>
>> --
>> João Paulo Figueira
>> Embedded MVP
>> http://nativemobile.blogspot.com/
>>
>> "Tim Brooks" <usna91@xxxxxxx> wrote in message
>> news:%23ByF8mU0FHA.268@xxxxxxxxxxxxxxxxxxxxxxx
>>> All,
>>>
>>> My app compiles fine (yes, I know, that proves nothing) using
>>> ssceoledb30.h A simple call to open an Accessor on the sdf file (in the
>>> correct directory) keeps returning "Class not registered". I've
>>> inherited from CDataSource and am calling:
>>>
>>> HRESULT CSqlCeDataSource::Open(LPCTSTR pszDbFile)
>>> {
>>> CDBPropSet propset(DBPROPSET_DBINIT);
>>> propset.AddProperty(DBPROP_INIT_DATASOURCE, pszDbFile);
>>> return CDataSource::Open(CLSID_SQLSERVERCE_3_0, &propset);
>>> }
>>>
>>> -------------------------------------------------
>>> The base Open method is defined as:
>>>
>>> HRESULT CDataSource::Open(const CLSID& clsid, DBPROPSET* pPropSet =
>>> NULL, ULONG nPropertySets=1) throw()
>>> {
>>> HRESULT hr;
>>> m_spInit.Release();
>>> hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER,
>>> __uuidof(IDBInitialize), (void**)&m_spInit);
>>> if (FAILED(hr))
>>> return hr;
>>> // Initialize the provider
>>> return OpenWithProperties(pPropSet, nPropertySets);
>>> }
>>> --------------------------------------------------------
>>> I've followed the rather sparse install instructions with the SqlMobile
>>> SetUp help file and deployed the correct cab files. I'm not that up on
>>> ATL so I'm sort struggling to figure out where the problem is with my
>>> code or if I'm missing the correct libraries on the device....
>>>
>>> Not that there aren't potential problems with the code but it seems more
>>> a configuration issue......
>>>
>>> Any help would be greatly appreciated....
>>>
>>> tim
>>>
>>
>>
>
>


.


Quantcast