Before installing the sybase package you suggested, I did another test with
a different sybase package (sybpydb) we had installed.
$ <svc_imagine_dev@imagrfpdev1:[~/web/web2py]$> *python ./web2py.py -S
welcome*
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2015
Version 2.10.4-stable+timestamp.2015.04.26.15.11.54
Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000
WARNING:web2py:import IPython error; use default python shell
Python 2.7.9 (default, May 28 2015, 14:04:54)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>* import sybpydb*
>>> connection = sybpydb.connect(servername = 'myservername',
user='myusername', password = 'mypassword')
>>> print connection
<sybpydb.Connection object at 0x2360490>
>>> cursor = connection.cursor()
>>> cursor.execute("SELECT * FROM hts_database_config")
>>> rows = cursor.fetchall()
>>> for row in rows:
... print (row)
...
(u'Cash Balance Management', 0, None, None)
(u'Cash Balance Start Date', None, None, None)
(... some additional rows)
>>> cursor.close()
>>> connection.close()
>>>
>>> db = DAL('sybase://myusername:mypassword@myservername/mydbname')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py",
line 171, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
File "/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py",
line 457, in __init__
raise RuntimeError("Failure to connect, tried %d times:\n%s" %
(attempts, tb))
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
File "/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py",
line 435, in __init__
self._adapter = ADAPTERS[self._dbname](**kwargs)
File
"/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/base.py",
line 53, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
File
"/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/mssql.py",
line 465, in __init__
self.find_driver(adapter_args, uri)
File
"/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/base.py",
line 187, in find_driver
raise RuntimeError("no driver available %s" % str(self.drivers))
RuntimeError: no driver available Sybase
As you can see, the connection works with the package sybpydb, but not with
DAL.
Do I need a different adapter in web2py/gluon/packages/dal/pydal?
What's missing here to make DAL work with Sybase?
Why installing the Sybase package you suggested would make a difference
when using DAL?
I would imagine that the Sybase package you suggested should work similarly
to sybpydb, right?
I would greatly appreciate any help and suggestions to make this work.
Thanks,
EF
On Monday, June 1, 2015 at 6:12:38 PM UTC-4, EF wrote:
> Hi,
> I'm new to web2py and trying to test the connectivity to Sybase.
> I tried testing this on Linux:
> >>> db = DAL('sybase://myuserid:mypswd@mysybaseserver/mydbname')
>
> (please note that I used dummay names in the above statement, but the
> correct ones when testing.)
>
> I got the following error:
> Traceback (most recent call last):
> File "<console>", line 1, in <module>
> File
> "/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py", line
> 171, in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
> File
> "/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py", line
> 457, in __init__
> raise RuntimeError("Failure to connect, tried %d times:\n%s" %
> (attempts, tb))
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
> File
> "/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/base.py", line
> 435, in __init__
> self._adapter = ADAPTERS[self._dbname](**kwargs)
> File
> "/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/base.py",
> line 53, in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
> File
> "/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/mssql.py",
>
> line 465, in __init__
> self.find_driver(adapter_args, uri)
> File
> "/home/svc_imagine_dev/web/web2py/gluon/packages/dal/pydal/adapters/base.py",
> line 187, in find_driver
> raise RuntimeError("no driver available %s" % str(self.drivers))
> RuntimeError: no driver available Sybase
> Questions:
> 1. Where can I find the Sybase driver? (we are using Adaptive Server
> Enterprise/15.7)
> 2. Where should it be installed?
> 3. Once I have the correct driver, is there anything else I need to do to
> test the connection?
>
> Thanks,
> EF
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.