ADOCE C++ and CDB problem 
Author Message
 ADOCE C++ and CDB problem

Hi!

I created a program that connects to cdb database using ADOCE. The program
doesn't give errors but the table does nothing, i know this because i check
the table with a program ive written in evb. This is the maincode, can
anyone help me?

  hr = CoInitializeEx(NULL,COINIT_MULTITHREADED);

  VariantInit(&varConn1);
  VariantInit(&varTSQL);
  VariantInit(&varEmpty);

  hr = CLSIDFromProgID( tsADOCE30ConnProgID, &tClsid );

  hr = CoCreateInstance (tClsid, NULL, CLSCTX_INPROC_SERVER |
CLSCTX_LOCAL_SERVER, IID__Connection, (LPVOID *)&iADOCEConn);

  if(iADOCEConn && !FAILED(hr))
  {
    hr=iADOCEConn->put_Provider(TEXT("cedb"));
    hr=iADOCEConn->Open(TEXT("data source = \tst.cdb"),TEXT(""),
TEXT(""),MSADOCE::adOpenUnspecified);
 hr=CLSIDFromProgID( tsADOCE30RSProgID, &tClsid );
    hr = CoCreateInstance (tClsid, NULL, CLSCTX_INPROC_SERVER |
CLSCTX_LOCAL_SERVER, IID__Recordset,(LPVOID *)&iADOCERS);

    if(iADOCEConn && !FAILED(hr))
 {
      varConn1.pdispVal=iADOCEConn;
   varConn1.vt=VT_DISPATCH;
   hr=iADOCERS->put_ActiveConnection(varConn1);

   varTSQL.bstrVal=SysAllocString(TEXT("INSERT INTO ngh VALUES(10,
'sdfdsfsd', 0)"));
   varTSQL.vt=VT_BSTR;
   iADOCERS->Open(varTSQL,varEmpty, MSADOCE::adOpenForwardOnly, MSADOCE::
adLockReadOnly, MSADOCE::adCmdUnknown);
   SysFreeString(varTSQL.bstrVal);

 }
  }



Tue, 08 Jun 2004 22:41:44 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to read bitmap from a cdb file through ADOCE

2. Using ADOCE to access a database ported from mdb to cdb

3. ADOCE looses data (.cdb files)

4. Modify a record in a cdb using Adoce for C++?

5. ADOCE 3.0, ADOCE 3.1 include files for Handheld PC

6. MSADOCE VC++ and CDB problem

7. ADOCE 3.1 and C++

8. ADOCE 3.1, C++ and Update method

9. ADOCE + C++ (WHY ONLY USE IT ONCE?)

10. Adoce Embedded Visual C++ sample

11. ADOCE inner join problem

12. ADOCE using MFC OLE - Problem with Fields.GetItem()

 

 
Powered by phpBB® Forum Software