2

I want to get the count of no. of connections currently open with an ms-access database.

For example two applications are working with the same database. Then how can I get this count? Is there is ms-access function or any facility in pypyodbc?

Using pypyobdc, how can I get no. of open connections with a database??

hsvyas4u
  • 158
  • 2
  • 9
  • Is this helpful at all?: http://support.microsoft.com/kb/198755/en – VBlades Jul 03 '14 at 12:27
  • Actually I need python code for this functionality. – hsvyas4u Jul 08 '14 at 16:49
  • Is there no python to ADODB compatability? Surely there's a way to do it. – VBlades Jul 09 '14 at 22:59
  • @VBlades Yes, pywin32 can create an ADODB.Connection object but I just tried the method in the answer cited above under Python 2.7 and unfortunately it does not seem to work. :( – Gord Thompson Jul 13 '14 at 09:19
  • @GordThompson: Hmm. Does it seem to be an issue with the technique itself or does it pertain to ADO via Python? I'd wager on the former, I think. Well, this post surfaced while searching for the issue: http://www.utteraccess.com/forum/Who-s-Logged-Who-s-Con-t1897146.html. I have not played with it yet, but seemed to get loads of praise. I guess first thing is to make sure we have a solution that works natively, at least, before trying to making it work with the outside world. – VBlades Jul 13 '14 at 12:24
  • @VBlades The technique works okay in VBScript. The problem seems to be an issue with pywin32 or Python itself. The .OpenSchema call needs to have the second argument omitted, but Python/pywin32 won't accept that. Including anything for the second argument (even `None` in Python) results in "Object or provider is not capable of performing requested operation." – Gord Thompson Jul 13 '14 at 12:43
  • exactly @GordThompson cant omit second argument of OpenSchema. In the syntax OpenSchema(querytype,criteria,schemaid). criteria is array of query constraints. neither None nor [] nor '' nor omiting is working. – hsvyas4u Jul 13 '14 at 16:54
  • import adodbapi myConn = adodbapi.connect('test') **rs = myConn.connector.OpenSchema(20) This works** but not **rs = myConn.connector.OpenSchema(-1)** – hsvyas4u Jul 13 '14 at 16:55
  • @hsvyas4u: Sorry, not familiar with Python or its pywin32 implementation to be help but, is it possible to have a function in Access to perform the technique internally, returning a ADO recordset, and have the Python script just tap into the returned recordset to avoid this issue? – VBlades Jul 13 '14 at 21:36

0 Answers0