How to use web2py DAL with sybase?

163 views
Skip to first unread message

dlypka

unread,
May 16, 2012, 8:47:59 AM5/16/12
to web...@googlegroups.com
I see this posting which has some sybase adapter code:

Is there anything else?

I have a need to use web2y + sybase at work.

Thanks.

Massimo Di Pierro

unread,
May 16, 2012, 11:42:05 AM5/16/12
to web...@googlegroups.com
web2py includes an adapter but nobody has tested it. If you can help us test it we can help you debug any problem that may arise. Compatibility with sybase and other SQL DB engines is a priority.

dlypka

unread,
May 16, 2012, 11:51:39 AM5/16/12
to web...@googlegroups.com

I do not see any reference to "sybase" in 1.99.7 dal.py.

Please point me to the sybase adapter.

There are 2 of us developers here at work who can test it for you on a large corporate sybase database.

Thanks.

Massimo Di Pierro

unread,
May 16, 2012, 5:10:28 PM5/16/12
to web...@googlegroups.com
Will send it tonight. Basically Sybase is almost the same as MSSQL. Do you a preference for one of the pyhton drivers for sybase?

dlypka

unread,
May 16, 2012, 5:24:02 PM5/16/12
to web...@googlegroups.com
No preference on which python driver for sybase.
So whatever you select is fine with us.
Thanks.
- Dave Lypka.

Massimo Di Pierro

unread,
May 16, 2012, 5:48:39 PM5/16/12
to web...@googlegroups.com
I just committed a SybaseAdapter using this driver:


It extends the MSSQLAdapter but uses the other driver and Sybase types.
It needs testing.

You can use it with

DAL('sybase://dsnstring')

or

DAL('sybase://username:password@hostname:port/dbname')

It uses this line to built the dsn string:

   dsn = 'sybase:host=%s:%s;dbname=%s' % (host,port,db)

This is one line I am not sure about because the docs for the adapter do not explain it and I cannot try it.

Massimo

dlypka

unread,
May 16, 2012, 6:37:04 PM5/16/12
to web...@googlegroups.com
OK I will download the trunk and try it tomorrow.

Thanks.

dlypka

unread,
May 19, 2012, 9:02:07 PM5/19/12
to web...@googlegroups.com
Hi:

FYI - we did a lot of work to setup the corporate sybase environment and successfully connected to sybase using
the sybase client tools Thursday night. And we installed and tested the web2py Welcome app on the corporate laptop.
We expect to start trying the web2py sybase adapter on Monday.


On Wednesday, May 16, 2012 4:48:39 PM UTC-5, Massimo Di Pierro wrote:
I just committed a SybaseAdapter using this driver:


It extends the MSSQLAdapter but uses the other driver and Sybase types.
It needs testing.

You can use it with

DAL('sybase://dsnstring')
D

dlypka

unread,
May 22, 2012, 6:29:59 AM5/22/12
to web...@googlegroups.com
Our corporate standard OS is 32 bit Windows Vista.
The Sybase driver list at sourceforge.net is only for Windows XP which will not work.
I searched internet and it looks like the only good sybase driver is one that has to be purchased.
There is also one with source which has to be built but that needs the Sybase SDK which is very expensive.
Anyway, we have an ODBC driver installed and working  on our Vista machine.

So can we simply change dal.py to use odbc here?

i.e. will it work if we make this change?:

class SybaseAdapter(MSSQLAdapter):

    driver = globals().get('Sybase',None)

to 

    driver = globals().get('pyodbc',None)  <---------------------------------------------


Another temporary option is to take the 30 day trial driver from here:

Also note that we are using port forwarding and our database machine is very remote.
It is NOT the case that we have sybase installed locally on our laptop.

I also looked at the open source driver here
but even if we could somehow build it with the sybase SDK, I think it assumes sybase is installed locally.
Not sure if it can handle accessing a remote server.


Please advise.

Thanks.
Reply all
Reply to author
Forward
0 new messages