a problem about ADOCE and SQL SERVER CE 
Author Message
 a problem about ADOCE and SQL SERVER CE

The following is my code:

#import "d:\\Examples\\adoce31.tlb" rename ("EOF", "A_EOF")
rename_namespace ("AdoNS")
#import "d:\\Examples\\adoxce31.tlb" rename ("EOF", "A_EOF")
rename_namespace ("AdoXNS")
const LPTSTR lpConnection =
_T("Provider=Microsoft.SQLServer.OLEDB.CE.1.0;Data
Source=\\test.sdf");

// Create a database (Catalog)
void Listing16_1()
{
 AdoXNS::_CatalogPtr pCatalog;
 HRESULT hr;
 hr = pCatalog.CreateInstance(_T("ADOXCE.Catalog"));
 if(FAILED(hr))
 {
  cout << _T("Could not create catalog object") << endl;
  return;
 }

But when I run it , it show me "Could not create catalog object". This
means I failed in

hr = pCatalog.CreateInstance(_T("ADOXCE.Catalog"));

Can you tell me where is error in my code?



Tue, 08 Feb 2005 14:11:02 GMT  
 a problem about ADOCE and SQL SERVER CE

Quote:
>  HRESULT hr;
>  hr = pCatalog.CreateInstance(_T("ADOXCE.Catalog"));
>  if(FAILED(hr))
>  {
>   cout << _T("Could not create catalog object") << endl;
>   return;
>  }

what HRESULT  are you getting returned?

--

MarkyD
============================
I'm out of my mind right now,
but feel free to leave a message.....



Tue, 08 Feb 2005 16:58:39 GMT  
 a problem about ADOCE and SQL SERVER CE
I had the same problem. You actually need to use the
text "ADOXCE.Catalog.3.1" in your CreateInstance call.
Ditto for the Connection object, etc.
(i.e. "ADOCE.Connection.3.1").

Quote:
>-----Original Message-----
>The following is my code:

>#import "d:\\Examples\\adoce31.tlb" rename
("EOF", "A_EOF")
>rename_namespace ("AdoNS")
>#import "d:\\Examples\\adoxce31.tlb" rename
("EOF", "A_EOF")
>rename_namespace ("AdoXNS")
>const LPTSTR lpConnection =
>_T("Provider=Microsoft.SQLServer.OLEDB.CE.1.0;Data
>Source=\\test.sdf");

>// Create a database (Catalog)
>void Listing16_1()
>{
> AdoXNS::_CatalogPtr pCatalog;
> HRESULT hr;
> hr = pCatalog.CreateInstance(_T("ADOXCE.Catalog"));
> if(FAILED(hr))
> {
>  cout << _T("Could not create catalog object") << endl;
>  return;
> }

>But when I run it , it show me "Could not create catalog
object". This
>means I failed in

>hr = pCatalog.CreateInstance(_T("ADOXCE.Catalog"));

>Can you tell me where is error in my code?
>.



Wed, 09 Feb 2005 15:39:46 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. eVC and SQL server CE / ADOCE

2. ADOCE and SQL CE on NetPad 5000 (Ce.net)

3. ADOCE and SQL CE recordset problem

4. Using SQL Server 1.1, EVC++, ADOCE 3.1 and having problems

5. SQL Server CE 2.0, EVC++4, and CE.NET

6. SQL Server CE, CE.NET and eVC++ 4

7. How do I register ADOce and SQL CE dll in PPC2002 emulation

8. Install and Access SQL Server CE

9. What difference between put_Value and appendchunk in ADOCE31 for SQL Server CE

10. SQL Server 2000 Windows CE Edition

11. rapi & sql server ce

12. Emulator and SQL Server CE

 

 
Powered by phpBB® Forum Software