connect to ms sql server with odbc

mierdatutis mi mmm286 at gmail.com
Mon Aug 31 07:08:39 CEST 2009


Hi,

I'm newbie in python. I try to connect to remote server with ms sql
server from my ubuntu. I install pyodbc and I do:

 >>> conn = >>> Conn =
 pyodbc.connect("DRIVER=
{FreeTDS};SERVER=defekas62;UID=emuser;PWD=temporal;DATABASE=em620")
pyodbc.connect ( "DRIVER = () FreeTDS; SERVER = defekas62; UID =
emuser; PWD = temporal; em620 DATABASE =")
 cursor = conn.cursor() cursor = conn.cursor ()
 >>> for row in cursor.execute("select USERNAME from JOBACTIONS"): >>>
Para la fila en cursor.execute ( "usuario seleccionar de
JOBACTIONS"):
 ... ... print row.USERNAME row.USERNAME de impresión
   File "<stdin>", line 2 Archivo "<stdin>", línea 2
     print row.USERNAME row.USERNAME de impresión
         ^ ^
 IndentationError: expected an indented block
Why this error?
Many thanks and sorry for my english



More information about the Python-list mailing list