News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

[Help]About JRO.CompactDatabase

Started by Loveasm, February 28, 2006, 09:51:52 AM

Previous topic - Next topic

Loveasm

INC FILE


    sCLSID_JetEngine TEXTEQU  <{0DE88C160h,0FF2Ch,011D1h,{0BBh,06Fh,000h,0C0h,04Fh,0AEh,022h,0DAh}}>
    sIID_IJetEngine TEXTEQU <{09F63D980h,0FF25h,011D1h,{0BBh,06Fh,000h,0C0h,04Fh,0AEh,022h,0DAh}}>

_vtIJetEngine   MACRO    CastName:REQ
                      _vtIDispatch    CastName
      CompactDatabase    comethod2 ?
ENDM

szSDB db   'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\test.mdb;Jet OLEDB:Database password=123',0
szDDB db   'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\new.mdb;Jet OLEDB:Database password=456',0


IJetEngine STRUCT
_vtIJetEngine IJetEngine
IJetEngine ENDS

THE ASM CODE
       local @szSDbLink[512]:WCHAR,@szDDbLink[512]:WCHAR
                invoke CoInitialize,NULL
                invoke MultiByteToWideChar,CP_ACP,MB_PRECOMPOSED,addr szSDB,-1,addr @szSDbLink,sizeof @szSDbLink
invoke MultiByteToWideChar,CP_ACP,MB_PRECOMPOSED,addr szSDB,-1,addr @szSDbLink,sizeof @szSDbLink
invoke CoCreateInstance,addr CLSID_IJetEngine,0,7,addr IID_IJetEngine,addr @jet
.if eax==S_OK
mov esi,@jet
mov esi,[esi]
assume esi:ptr IJetEngine
invoke [esi].CompactDatabase,addr @szSDbLink,addr @szDDbLink
                assume esi:nothing
.endif
invoke CoUninitialize


:(    is error.... 
I can't find any error....   Please help....  Thanks

KetilO

Hi

Yes it fails. Dont know why. Maybe someone with experience with com can have a look at it.

KetilO

[attachment deleted by admin]

Loveasm

Hi,KetilO
Thank you very much. :U :U :U
Ok.Let me try again!

Loveasm

 :( :( :(
:'(

It fails......  Who can help?