--- In [email protected], "entropyreduction" 
<alancampbelllists+ya...@...> wrote:
>
> 
> But com would probably work too. Never tried wit with Access, but
> generally seems to work okay with MsOffice stuff. 

There seems to be an unexpected issue with com.

Following script fails to open the data base. Debug output, and equivalent 
working vbscript follows. Equivalent dde plugin functionality also works.

local com_type, com_status
local appAccess = com.create_object("Access.Application")
local strdb=?"C:\Documents and Settings\Sheri\My 
Documents\MSAccessData\SheriTest.mdb"
win.debug(appAccess, com_type, com_status)
win.debug(appAccess.get_object_description("fdnpth","OpenCurrentDataBase"))
appAccess.OpenCurrentDatebase(strdb)
win.debug(com_type, com_status)
appAccess.Visible=1
messagebox("OK", "See open db?") ;;no
appAccess.Release
com.unload
quit

=========================
debug output of the above:
c_3000 _Application OK
_Application

function:  OpenCurrentDatabase(IN BSTR filepath, IN BOOL exclusive (optional), 
IN BSTR bstrPassword (optional))
_Application ERRORS: com.method: Can't interrogate object  (sys code 80020006: 
"Unknown name.")
 (sys code 80020006: "Unknown name.")
========================
'vbscript equivalent
option explicit
Dim appAccess, strDB
strDB="C:\Documents and Settings\Sheri\My Documents\MSAccessData\SheriTest.mdb"
Set appAccess = _
    CreateObject("Access.Application")
appAccess.Visible=1
' Open database in Microsoft Access window.
appAccess.OpenCurrentDatabase strDB
msgbox "See it open?"
' yes
========================
;dde equivalent
if (not anywindow("=MSAccess")) do
  do("msaccess.exe")
  wait.for(visiblewindow("Microsoft Access"))
endif
dde.start_conversation("MSAccess", "System")
dde.execute(?"[OpenDatabase C:\Documents and Settings\Sheri\My 
Documents\MSAccessData\SheriTest.mdb]")
messagebox("OK topmost", "See open db?") ;;yes
dde.stop_conversation
dde.unload
quit


Reply via email to