1 Reply Latest reply: Dec 3, 2013 6:55 PM by cj RSS

    cx_Oracle and ctypes issue

    b9f1cd0e-8ada-4e70-afae-f7575802f3d6

      Hello,

       

      I have some code that works fine (using ctypes to call a dll), unless I run cx_Oracle first then I get an error:

      WindowsError: [Error 126] The specified module could not be found

       

      An example of the code is below:

      query = '''select * from table'''

      cx_Oracle.makedsn(host="host", port=1111, service_name='service.name')

      db_conn = cx_Oracle.connect('/@somewhere')

      cursor = db_conn.cursor()

      cursor.execute(query)

      db_conn.close()


      lib_path = os.path.join("C:\\Program Files (x86)\\app", "data.dll")

      self.externallib = ctypes.windll.LoadLibrary(lib_path)


      I am using python 2.7.5


      If I comment out the cx_Oracle code it works fine OR if I run it first.


      Any thoughts appreciated,


      Bevan