Use a COM-server with python

Bill Bell bill-bell at bill-bell.hamilton.on.ca
Wed Nov 7 07:44:30 EST 2001


Marc Gehling <m.gehling at gmx.de> wrote, in part:
> Can someone translate this vb into python ?
> 
> Dim oRepo As MXLib.MXRepository
> Dim oNewFolder As MXFolder
> Set oRepo = New MXRepository
> oRepo.dbUserName = "rep"
> oRepo.dbPassword = "rep"
> oRepo.repUserName = "Administrator"
> oRepo.repPassword = "Administrator"
> oRepo.dbConnectString = "Inf ora8"
> oRepo.repositName = "data"
> oRepo.connect
> oRepo.CreateFolder "testfolder", "folderdescr", 0, "Administrators",
> oNewFolder oRepo.Disconnect

Marc,

I would hazard a guess that there should be a new-line between 
'oNewFolder' and 'oRepo.Disconnect' in the final line of code.

If so, then Python might be:

from win32com.client import Dispatch
oRepo = Dispatch ( 'MXLib.MXRepository' )
oRepo.dbUserName = "rep"
oRepo.dbPassword = "rep"
oRepo.repUserName = "Administrator"
oRepo.repPassword = "Administrator"
oRepo.dbConnectString = "Inf ora8"
oRepo.repositName = "data"
oRepo.connect
oRepo.CreateFolder ( "testfolder", "folderdescr", 0, \
	"Administrators", oNewFolder )
oRepo.Disconnect

Bill

"It is the time that you have wasted for your rose that makes your rose so important."--St-Exupery




More information about the Python-list mailing list