UMRA - UMRA COM - Get/Set Data
April 23rd, 2010 / Send feedback » / by admin
Ok perfect, we now have our UMRA script, we are now going to create a simple .ASP page that will connect to UMRA via the COM object “connect” method, and push data to our script, as well as pull data from the script.We will follow the same steps as in the previous blog, on how to connect to UMRA via it’s COM “connect” method, see this post here for code.Here is the sample code that will set and get data via the UMRA COM.
VB Script
'Create/Set Variables Dim RetVal Dim UMRA_Server Dim UMRA_ Port Dim My_Pulled_UMRA_Variable UMRA_Server = "MyServerName" UMRA_Port = 56814 'End Create/Set Vairbales Set Umra = Server.CreateObject("UMRAcom.Umra") ' Creates a new reference to the UMRACom DLL RetVal=Umra.Connect(UMRA_Server,UMRA_Port) ' Use the "Connect" Method, it will take 2 paramaters UMRA_Server and UMRA_Port 'The SetVariableText Method takes 2 paramaters (Your UMRA Variable Name, Your Text) Umra.SetVariableText "%text_from_webpage%","Add this text to my variable" RetVal=Umra.ExecuteProjectScript(UMRA_Project) ' Use the "ExecuteProjectScript Method, takes 1 paramater UMRA_Project. 'The GetVariableText Method works the same way as the Set, however we are now getting databack from UMRA AFTER the Project has ran. 'The GetVariableText has 2 paramaters (Your UMRA Variable Name You Want to Get, Your Variable You Want to Store the Data In) RetVal=Umra.GetVariableText("%my_umra_var%",My_Pulled_UMRA_Variable) 'Now that we have the variable %my_umra_var% data stored in My_Pulled_UMRA_Variable we can now print it out to the page Response.write "My Pulled Value is:" & My_Pulled_UMRA_VariableIf everything is done correctly, you will get a print out on the page saying “My Extra Text Add this text to my variable”. And there you go, you now just pushed data to UMRA COM and executed a project, and retrieved data from it. So what have we learned so far? We learned how to connect to UMRA via the COM with the “connect” method. We are now able to push/get data from UMRA projects. What next? In my next post I will show you have to loop through a table of data!
Feedback awaiting moderation
This post has 15 feedbacks awaiting moderation...

