connect to ms sql server with odbc

M

mierdatutis mi

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:
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 ()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
 
S

Sean DiZazzo

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

Welcome to python. The error is telling you exactly what it says.
There is a block of code that is not indented properly. Perhaps your
code was edited with two different editors?

Tabs are not equal to spaces. Go thru your code and be sure that you
are consistent with all of your spacing. I believe 4 spaces per
indent (without tabs) is the current Python standard.

~Sean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top