Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Pervasive Monitor 1

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
Hi Folks,

I was just wondering if it was possible to access the pervasive monitor programatically. Basically, the backup on my application server is failing almost every night due to file access. I would like to be able to write a script to check what user accounts are accessing the pervasive tables at a certain time. Is this possible. Does the monitor pull the data from some table somewhere??

Mighty
 
The Monitor is not available but the API used by the Monitor is available. You can use DTI or DTO to access the Monitor data. You'll need to be using PSQL 2000 or later to get DTI and PSQL 2000i or later to get DTO.


Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
Hi Mirtheil,

You are obviously "the man" when it comes to Pervasive. Excuse my ignorance but what is DTI and DTO

Mighty
 
Thanks mirtheil,

That seems to be a pretty good source of info. I will check it out.

Mighty
 
Hi Mirtheil,

I'm Back!! I found some sample code on the Pervasive site and decided to check it out. I am just trying to get the net addresses and usernames of connected users - nothing too taxing. However, my script falls over at the first hurdle:

Set mySession = CreateObject("DTO.DtoSession.1")

The following error message is given:

ActiveX Component can't create object: 'DTO.DtoSession.1")

I am only running Pervasive SQL 2000i. Does this version support DTO??

Mighty
 
Hi Mirtheil,

Thanks for that. At the moment I am just messing around trying to get some info from the monitor before I get down to the nitty gritty. I have the following VBScript code:

' Declare variables
Dim mySession, result, myMonitor, myMKDEClients, i

' Instantiate session and connect
Set mySession = CreateObject("DTO.DtoSession.1")
result = mySession.Connect("myServer","myName", "myPass")

' Get monitor object from session
Set myMonitor = CreateObject("DTO.DtoMonitor.1")
myMonitor = mySession.Monitor

' Now get Mkde clients from monitor
Set myMKDEClients = CreateObject("DTO.DtoMkdeClients.1")
myMKDEClients = myMonitor.MkdeClients

' Loop through each item in the collection
wscript.echo myMKDEClients.count

Your install package seems to have worked fine - thanks. But I get a error at the highlighted line above saying that "Object doesn't support this object or method: Monitor". Any ideas?

Mighty
 
If you were using VB, I would think declaring the variables would work like you've posted. I was able to get it to work by using:
Code:
' Get monitor object from session
set myMonitor = mySession.Monitor

' Now get Mkde clients from monitor
set myMKDEClients = myMonitor.MkdeClients

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top