mattn / go-adodb

Microsoft ActiveX Object DataBase driver for go that using exp/sql
http://mattn.kaoriya.net/
MIT License
142 stars 36 forks source link

How to call: CJetEngine::CompactDatabase(strConnection, strCompactedDBConnection) #23

Closed gvgarven closed 8 years ago

gvgarven commented 8 years ago

I want to compact a (.mdb) file, but how can i use Go to do that like CPP ?

mattn commented 8 years ago

I don't make sure but maybe.

ole.CreateObject("JRO.JetEngine")
unknown, _ := oleutil.CreateObject("JRO.JetEngine")
jro, _ := unknown.QueryInterface(ole.IID_IDispatch)
ret, _ := oleutil.CallMethod(jro, "CompactDatabase", strOldConnect, strNewConnect)
gvgarven commented 8 years ago

Yeah, it is proved that this is well done. Thank you very much.