Jet OLEDB:Engine on Windows7 (64bit) - Compact Access Database problem
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: Jet OLEDB:Engine on Windows7 (64bit) - Compact Access Database problem

Threaded View

  1. #1
    Join Date
    Apr 2013
    Location
    Prague / Cracow
    Posts
    47

    Jet OLEDB:Engine on Windows7 (64bit) - Compact Access Database problem

    Hey ho!

    I'm using ADO in my WINAPI project with Microsoft.ACE.OLEDB.12 (msado26.tlb) with no problem, but now I need to be able to compact the database from my application and i've learnt that to do so i need to add msjro.dll to my project to execute the following code:

    Code:
    void db_compact()
    {
    	try
    {
       IJetEnginePtr jet(__uuidof(JetEngine));
      jet->CompactDatabase( "Provider=Microsoft.Jet.OLEDB.12.0;Data Source=d:\\xxx.accdb;Jet OLEDB:Database Password=test", 
    "Provider=Microsoft.Jet.OLEDB.12.0;Data Source=d:\\xxx.accdb;" 
    "Jet OLEDB:Engine Type=5;Jet OLEDB:Database Password=test");
    }
    catch(_com_error e) 
    {       
      errorhandler(e);  
    }
    	
    }
    IJetEnginePtr and JetEngine are properly recognized as classes in my Visual Studio but the problems is that when i try to import the JET dll itself by:
    Code:
    #import "C:\Program Files (x86)\Common Files\System\ado\msjro.dll" no_namespace
    my compiler gives the following errors:
    2 <path>\msjro.tlh IntelliSense: identifier "_Recordset_DeprecatedPtr" is undefined 196
    3 <path>\msjro.tlh IntelliSense: identifier "_Recordset_DeprecatedPtr" is undefined 224
    4 <path>\msjro.tlh error C2146: syntax error : missing ';' before identifier 'ConflictTables' 196
    5 <path>\msjro.tlh error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 196
    6 <path>\msjro.tlh error C2146: syntax error : missing ';' before identifier 'GetConflictTables' 224
    7 <path>\msjro.tlh error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 224
    8 <path>\msjro.tlh warning C4183: 'GetConflictTables': missing return type; assumed to be a member function returning 'int' 224
    1 <path>\msjro.tli IntelliSense: identifier "_Recordset_DeprecatedPtr" is undefined 111
    9 <path>\msjro.tli error C2143: syntax error : missing ';' before 'IReplica::GetConflictTables' 111
    10 <path>\msjro.tli error C2433: '_RecordsetPtr' : 'inline' not permitted on data declarations 111
    11 <path>\msjro.tli error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 111
    12 <path>\msjro.tli error C2064: term does not evaluate to a function taking 2 arguments 115
    I cannot find any threat that gives some resolution to this problem which (from what i've read) apparently appears on WIN7 64 bit only (my OS!) although the application i compile is a WIN32.

    Has anyone heard about any solution for this? From what i've read on other forums the JET does not go together with 64 Win7 but somehowe I have it installed. Only my compilator doesn't understand those certain parts of msjro.tlh and .tli... while importing that msjro.dll. I am a bit lost... :-0

    will be grateful for any hint!

    cheers
    b.
    Last edited by berkov; June 20th, 2013 at 12:46 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center