Hello,
I am trying to programmatically close an SQL session.
For more context: I am using Pervasive 13.31.014.
I have also tried to run on the server and my workstation, same outcome.
I am using Python and pywin32 and I have been able to get to a point where I think it should be working as I intend.
As documented here:
Once I have a DtoSqlClient object, disconnecting the session should be as simple as calling the Disconnect method, right? The problem I am having is that I get a 7009 code returned back whenever I call Disconnect. Wherever I look code 7009 doesn't seem to have much more information on it other than 'Data is unavailable'
Has anyone ever encountered this error before, got any more ideas as to what causes the error to occur.
The return code would be
This is not the exact code (it may not even be correct python code) but is intended to give a general overview of the approach taken.
In the meantime, if I figure this out I'll update this post later.
Many Thanks
Ian
I am trying to programmatically close an SQL session.
For more context: I am using Pervasive 13.31.014.
I have also tried to run on the server and my workstation, same outcome.
I am using Python and pywin32 and I have been able to get to a point where I think it should be working as I intend.
As documented here:
Once I have a DtoSqlClient object, disconnecting the session should be as simple as calling the Disconnect method, right? The problem I am having is that I get a 7009 code returned back whenever I call Disconnect. Wherever I look code 7009 doesn't seem to have much more information on it other than 'Data is unavailable'
Has anyone ever encountered this error before, got any more ideas as to what causes the error to occur.
Code:
import win32com.client
session = win32com.client.Dispatch("DTO.DtoSession.2")
session.Connect(my_server_name, username, password)
monitor = session.Monitor
#get sql clients
sql_clients = monitor.SqlClients
list_of_sql_clients = list(sql_clients)
#attempt to disconnect a sqlclient just for example - normally within a loop
return_code = list_of_sql_clients[0].Disconnect()
if return_code != 0:
[indent]print(f"Error code: {return_code}, {session.Error(return_code)}")[/indent]
The return code would be
Code:
Error code: 7009, Data is unavailable
This is not the exact code (it may not even be correct python code) but is intended to give a general overview of the approach taken.
In the meantime, if I figure this out I'll update this post later.
Many Thanks
Ian