[Tutor] Difficulty connecting with odbc drivers

2006-04-15 Thread John CORRY








Hi,



I have downloaded the mxodbc product. I am using windows xp, python 2.4 and I
am trying to log onto a visual foxpro database
file. I have downloaded the visual foxpro driver. I
use the following code:



import mx.ODBC

import mx.ODBC.Windows

db =
mx.ODBC.Windows.DriverConnect('dsn=c:/test/m2m/data/cost_grid.dbf')

c = db.cursor()



and I get the following error:



Traceback (most recent call last):

 File
C:\Python24\Lib\site-packages\databasemanager.py, line 4, in ?

 db
= mx.ODBC.Windows.DriverConnect('dsn=c:/test/m2m/data/cost_grid.dbf')

OperationalError: ('IM002', 0, '[Microsoft][ODBC Driver
Manager] Data source name not found and no default driver specified', 6044)



What am I doing wrong and what do I need to do? Any help would be greatly appreciated.



Thanks,



John.








___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Difficulty connecting with odbc drivers

2006-04-15 Thread John CORRY








Hi,



I have downloaded the mxodbc
product. I am using windows xp,
python 2.4 and I am trying to log onto a visual foxpro
database file. I have downloaded
the visual foxpro driver. I use the following code:



import mx.ODBC

import mx.ODBC.Windows

db = mx.ODBC.Windows.DriverConnect('dsn=c:/test/m2m/data/cost_grid.dbf')

c = db.cursor()



and I get the following error:



Traceback (most recent call last):

 File
C:\Python24\Lib\site-packages\databasemanager.py, line 4, in ?

 db
= mx.ODBC.Windows.DriverConnect('dsn=c:/test/m2m/data/cost_grid.dbf')

OperationalError: ('IM002', 0, '[Microsoft][ODBC Driver
Manager] Data source name not found and no default driver specified', 6044)



What am I doing wrong and what do I need to do? Any help would be greatly appreciated.



Thanks,



John.








___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Difficulty connecting with odbc drivers

2006-04-15 Thread Liam Clarke
According to the eGenix docs:

Please refer to the ODBC manuals of your ODBC manager and database for
the exact syntax of the DSN_string. It typically has these entries:
'DSN=datasource_name;UID=userid;PWD=password;'  (case is important !).

So, you've got DSN lowercase...

On 4/16/06, John CORRY [EMAIL PROTECTED] wrote:



 Hi,



 I have downloaded the mxodbc product.  I am using windows xp, python 2.4 and
 I am trying to log onto a visual foxpro database file.  I have downloaded
 the visual foxpro driver.  I use the following code:



 import mx.ODBC

 import mx.ODBC.Windows

 db =
 mx.ODBC.Windows.DriverConnect('dsn=c:/test/m2m/data/cost_grid.dbf')

 c = db.cursor()



 and I get the following error:



 Traceback (most recent call last):

   File C:\Python24\Lib\site-packages\databasemanager.py,
 line 4, in ?

 db =
 mx.ODBC.Windows.DriverConnect('dsn=c:/test/m2m/data/cost_grid.dbf')

 OperationalError: ('IM002', 0, '[Microsoft][ODBC Driver Manager] Data source
 name not found and no default driver specified', 6044)



 What am I doing wrong and what do I need to do?  Any help would be greatly
 appreciated.



 Thanks,



 John.


 ___
 Tutor maillist  -  Tutor@python.org
 http://mail.python.org/mailman/listinfo/tutor



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Difficulty connecting with odbc drivers

2006-04-15 Thread John Corry
Liam,

Thanks for the quick response.  I have changed the code so that dsn is now
DSN.  However I get the same error.

Any other thoughts?

Regards,

John.

-Original Message-
From: Liam Clarke [mailto:[EMAIL PROTECTED]
Sent: 15 April 2006 15:02
To: [EMAIL PROTECTED]
Cc: tutor@python.org
Subject: Re: [Tutor] Difficulty connecting with odbc drivers


According to the eGenix docs:

Please refer to the ODBC manuals of your ODBC manager and database for
the exact syntax of the DSN_string. It typically has these entries:
'DSN=datasource_name;UID=userid;PWD=password;'  (case is important !).

So, you've got DSN lowercase...

On 4/16/06, John CORRY [EMAIL PROTECTED] wrote:



 Hi,



 I have downloaded the mxodbc product.  I am using windows xp, python 2.4
and
 I am trying to log onto a visual foxpro database file.  I have downloaded
 the visual foxpro driver.  I use the following code:



 import mx.ODBC

 import mx.ODBC.Windows

 db =
 mx.ODBC.Windows.DriverConnect('dsn=c:/test/m2m/data/cost_grid.dbf')

 c = db.cursor()



 and I get the following error:



 Traceback (most recent call last):

   File C:\Python24\Lib\site-packages\databasemanager.py,
 line 4, in ?

 db =
 mx.ODBC.Windows.DriverConnect('dsn=c:/test/m2m/data/cost_grid.dbf')

 OperationalError: ('IM002', 0, '[Microsoft][ODBC Driver Manager] Data
source
 name not found and no default driver specified', 6044)



 What am I doing wrong and what do I need to do?  Any help would be greatly
 appreciated.



 Thanks,



 John.


 ___
 Tutor maillist  -  Tutor@python.org
 http://mail.python.org/mailman/listinfo/tutor




___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Difficulty connecting with odbc drivers

2006-04-15 Thread Alan Gauld
 I have downloaded the mxodbc product.  I am using windows xp, python 2.4

 mx.ODBC.Windows.DriverConnect('dsn=c:/test/m2m/data/cost_grid.dbf')
 OperationalError: ('IM002', 0, '[Microsoft][ODBC Driver Manager] Data
 source name not found and no default driver specified', 6044)

 What am I doing wrong and what do I need to do?  Any help would be
 greatly appreciated.

You need to set up the driver using the ODBC management applet from 
Control Panel-Admin Tools. You don't mention doing that so it may 
be you need an extra step. Otherwise I dunno, sorry.

Alan G.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor