eVC++ SQLCE

MariusMarais
MariusMarais used Ask the Experts™
on
i'm having problems using eVC++ to connect to my SQLCE db. The NorthwindOleDb sample app works fine, but as soon as i try to use the code from the sample i get problems.

if i compile i get the following error:
"unresolved external symbol _DBGUID_SQL"

i included the SQLCE inc directory.

i thinks i need more project settings...

plz help...
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Have you included the corresponding LIB file in the Project setting?

Author

Commented:
ya...

i think i figured it out. i needed to add stuff to my StdAfx.h file.

pritty new to this stuff.

tanx anyway M

Commented:
Did you solve this problem?  I am not able to connect run NorthwindDb application in emulator mode.  Can you please help me how you did it?

Thanks In advance.

Vara P
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Commented:
I have the same problem with Northwind OLEDB example for eVC, when the application begins to run it shows an error message: Error - Initialize database. Can anyone help me with this problem?
The application dies when calling the method CoInitializeObject...

Thanks

Author

Commented:
i got SQLCE working, but am using ADO now.... works like a charm ;)

to run SQLCE on the emulator u need to register the following dlls on the emulator:
adoce31.dll
adocedb31.dll
adoceoledb31.dll
adoxce31.dll
msdaeren.dll
(these dlls can be found in the C:\Windows CE Tools\dataaccess31\wce300\x86em dir)

ssce20.dll
ssceca20.dll
ssceerror20en.dll
(these dlls can be found in the C:\Program Files\Microsoft SQL Server CE 2.0\Device\X86\I486 dir)

to create a SQLCE db:

  _CatalogPtr  pCatalog;
  CComVariant AConn;
  HRESULT hr;

  VariantInit(&AConn);

  hr = pCatalog.CreateInstance(_T("ADOXCE.Catalog.3.1"));
  if(FAILED(hr))
      goto Exit;
      
  hr = pCatalog->Create("Provider=Microsoft.SQLServer.OLEDB.CE.2.0;Data Source=\\My Documents\\Test.sdf",&AConn);

Exit:
      //Release Object
      if (pCatalog)
            pCatalog->Release();

      return hr;

just make sure u import the following:
#import "C:\Windows CE Tools\dataaccess31\wce300\arm\adoce31.dll" rename_namespace("adoce31") raw_interfaces_only
using namespace adoce31;

#import "C:\Windows CE Tools\dataaccess31\wce300\arm\adoxce31.dll" rename_namespace("adoxce31") raw_interfaces_only
using namespace adoxce31;

hope this helps

Commented:
This information was very helpful, however now I need to connect to a remote SQL server database.
Does anyone know how to specify the conncetion string?

I try with the other evc example of SQL Ce (eVCReplRdaHPC) but when is linking it shows the following:
Linking...
replrda.obj : error LNK2019: unresolved external symbol _CLSID_RemoteDataAccess referenced in function "void __cdecl InitializeReplicationRDA(void)" (?InitializeReplicationRDA@@YAXXZ)
replrda.obj : error LNK2019: unresolved external symbol _IID_ISSCERDA referenced in function "void __cdecl InitializeReplicationRDA(void)" (?InitializeReplicationRDA@@YAXXZ)
replrda.obj : error LNK2019: unresolved external symbol _CLSID_Replication referenced in function "void __cdecl InitializeReplicationRDA(void)" (?InitializeReplicationRDA@@YAXXZ)
replrda.obj : error LNK2019: unresolved external symbol _IID_ISSCEMerge referenced in function "void __cdecl InitializeReplicationRDA(void)" (?InitializeReplicationRDA@@YAXXZ)
replrda.obj : error LNK2019: unresolved external symbol __imp__CoCreateInstance referenced in function "void __cdecl InitializeReplicationRDA(void)" (?InitializeReplicationRDA@@YAXXZ)
replrda.obj : error LNK2019: unresolved external symbol __imp__SysFreeString referenced in function "long __cdecl AddSubscription(struct HWND__ *,unsigned int,unsigned int,long)" (?AddSubscription@@YAJPAUHWND__@@IIJ@Z)
showerr.obj : error LNK2001: unresolved external symbol __imp__SysFreeString
replrda.obj : error LNK2019: unresolved external symbol __imp__SysAllocString referenced in function "long __cdecl AddSubscription(struct HWND__ *,unsigned int,unsigned int,long)" (?AddSubscription@@YAJPAUHWND__@@IIJ@Z)
showerr.obj : error LNK2019: unresolved external symbol __imp__VariantClear referenced in function "void __cdecl ShowErrors(struct ISSCEErrors *,unsigned short *)" (?ShowErrors@@YAXPAUISSCEErrors@@PAG@Z)
showerr.obj : error LNK2019: unresolved external symbol __imp__VariantInit referenced in function "void __cdecl ShowErrors(struct ISSCEErrors *,unsigned short *)" (?ShowErrors@@YAXPAUISSCEErrors@@PAG@Z)
X86Rel/evcRepl.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.

evcRepl.exe - 11 error(s), 0 warning(s)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial