Page 1 of 1
TM1ServerLogDirectory
Posted: Wed Sep 16, 2015 1:05 pm
by AmbPin
Hello,
I am looking for a way to get the data or log files directory for a specified server in VBA code. Does anyone know if the above APi functionis the right thing to use and if so have any pointers on how to call it.
Many thanks.
Re: TM1ServerLogDirectory
Posted: Wed Sep 16, 2015 1:43 pm
by TrevorGoss
Hello,
I am looking for a way to get the data or log files directory for a specified server in VBA code. Does anyone know if the above APi functionis the right thing to use and if so have any pointers on how to call it.
What exactly do you mean by "to get the data or log files directory for a specified server in VBA code"? Do you mean to return the values in an Array? or by procedure?
My VB is weak but I found this code on stackoverflow, no TM1 API was used in this code:
Code: Select all
Sub LoopThroughFiles()
Dim MyObj As Object, MySource As Object, file As Variant
file = Dir("z:\testfolder\")
While (file <> "")
If InStr(file, "test") > 0 Then
MsgBox "found " & file
Exit Sub
End If
file = Dir
Wend
End Sub
You can edit this as you wish.
Re: TM1ServerLogDirectory
Posted: Wed Sep 16, 2015 1:51 pm
by AmbPin
Sorry,
Looking fo a way to determine the URL path to the log or data files folder for a specified server.
A VBA equivilant of the TI function GetProcessErrorFileDirectory()
I am trying to build a VBA UI that can be connected to more than one TM1 service at the same time and need to know the folder paths mentioned above for each.
Re: TM1ServerLogDirectory
Posted: Wed Sep 16, 2015 2:02 pm
by TrevorGoss
Ah ok,
Looking for a way to determine the URL path to the log or data files folder for a specified server.
A VBA equivalent of the TI function GetProcessErrorFileDirectory()
You could still pass the server name as an argument and presuppose the rest of the path string?
You could also open up the .cfg file and check the parameter for each server?
But I am unaware of a VBA equivalent for the TI function GetProcessErrorFileDirectory()
Trevor
Re: TM1ServerLogDirectory
Posted: Wed Sep 16, 2015 2:18 pm
by AmbPin
Thanks Trevor
I am trying to cater for situaltions where the TM1 services are on different hosts and physical servers. Also the possibility that the folder structures on these physical servers may be different.
Re: TM1ServerLogDirectory
Posted: Wed Sep 16, 2015 2:38 pm
by TrevorGoss
Hello again,
how about calling a TI which calls the TI function GetProcessErrorFileDirectory() and prints the return value out to a flat file, then pick up that flat file and tada....there is your path.
Re: TM1ServerLogDirectory
Posted: Wed Sep 16, 2015 3:00 pm
by AmbPin
Hmm, I have kind of done that.
I have a TI that sucks the contents of the tm1s.cfg file into a cube so I can get at all of the values that way.
Thanks again Trevor
Re: TM1ServerLogDirectory
Posted: Wed Sep 16, 2015 3:01 pm
by TrevorGoss
Hmm, I have kind of done that.
I have a TI that sucks the contents of the tm1s.cfg file into a cube so I can get at all of the values that way.
Thanks again Trevor
Indeed, these are all ways around your problem rather than facing it directly, good luck!
Trevor.
Re: TM1ServerLogDirectory
Posted: Wed Sep 16, 2015 4:01 pm
by tomok
The best place for this information, if needed by a TI process, or VBA, really is a cube. I normally put a cube in all my models that stores all this type of data, like data directory, logging directory, port#, etc., to make it easy to get to instead of having to open the .cfg file. It almost never changes so all you have to do is set it up and populate it one time.
Re: TM1ServerLogDirectory
Posted: Thu Sep 17, 2015 10:02 am
by AmbPin
tomok wrote: I normally put a cube in all my models that stores all this type of data
Good idea, thanks.