[DB-SIG] Connection string on informixdb DBI API 1.0
Andrés Meza
andres.meza@virtualnm.com
Thu, 23 May 2002 15:10:09 -0500
Greetings.
I am using the informixdb 1.3 module and my script refuse make
connection. I am not sure about the format of the connection string, so
I think the right way to make it is like this:
database_name@server_name:port:user:password
Please let me know if I am doing anything wrong.
Thanks,
--
Andrés Meza
Research + Development Manager
__NM S.A.__________________________________
e-mail: andres.meza@virtualnm.com
day time phone: (+572)6827794 ext.102
url: www.virtualnm.com
#!/usr/bin/python
try:
import informixdb #Import of Python-Informix module
except:
print "Error importing the informixdb module"
dbName = "sef"
serverName = "62.25.9.99"
serverPort = "432"
userName = "myuser"
password = "123"
cadDB = "%s@%s:%s:%s:%s" %
(dbName,serverName,serverPort,userName,password)
try:
d=informixdb.informixdb(cadDB)
c=d.cursor()
print "Conection done using DBI API 1.0"
except:
cadError = "Error connecting to database '%s'." % cadDB
print cadError
c.close()
d.close()