Guest User

Untitled

a guest
Jul 22nd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. """ Open a connection with provider in external DLL on IronPython"""
  2. import clr
  3. import sys
  4. pathParaDll = r"D:\workspace\2010\projetoXPTO\packages\Sybase11"
  5. sys.path.append(pathParaDll)
  6. clr.AddReferenceToFile("iAnywhere.Data.SQLAnywhere.dll")
  7. from iAnywhere.Data.SQLAnywhere import *
  8. con = SAConnection(r"uid=USUARIO;pwd=SENHA;ServerName=SERVIDOR;links=tcpip(host=127.0.0.1); min pool size=2; max pool size=9")
  9. con.Open()
  10. comm.CommandText = "select * from dummy"
  11. reader = comm.ExecuteReader()
  12. while reader.Read():
  13. print reader.GetInt16(0)
  14. con.Close()
Add Comment
Please, Sign In to add comment