Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Sample Code to Query a MIMSXServer

Keywords: 	  OLE MIMSXServer

Here is some sample code to drag out the values of the fields from the reply from a MIMSXServer. You'll have to substitute the variables for the Request, Instance and Field numbers.
gobjMIMS = ObjectOpen("MIMSX.MIMSXServer")
gobjMIMS.initialise
gobjMIMS.connect()
apiv = gobjMIMS.MIMSAPIVersion
apih = gobjMIMS.MIMSAPIHandle
rc = gobjMIMS.Blocks
rc1 = rc.New("Employees")
rc2 = rc1.Requests
rc2.New("Request")
rc5 = rc1.Requests("Request")
rc6 = rc5.Instances
rc6.New("Instance")
rc8 = rc5.Instances("Instance")
rc5.AddFieldNameValue("_Service", "EMPLOYEE.Retrieve")
rc5.AddFieldNameValue("_ReplyList", "Employee,FirstName,LastName,Paygroup,Position,EmailAddress")
rc8.AddFieldNameValue("SearchStatus", "A")
Reply = rc1.Send

;need to substitute variables for the (1)'s below:
rp1 = Reply.Requests(1)
rp2 = rp1.Instances(1)
rp3 = rp2.Fields(1)
rp4 = rp3.Value
Message("Employee", StrTrim(rp4))
exit

Article ID:   W15234