The error message seems to indicate that SQLDriverConnectW function is
not present in your setup.
Would you please try issuing pyodbc connect from python itself?
Something like this:
>>> import pyodbc
>>> pyodbc.connect(unicode("Driver={SQL
>>> Server};Server=Localhost;uid=sa;pwd=pwds"))
On Jan 29, 7:08 am, kgingeri <[email protected]> wrote:
> Ok so no more pyodbc issues - the module loads just fine. Thanks
> again Massimo!
>
> I have unixodbc and freetds working - i can run iodbctest just fine
> to my database, and run queries etc, but now I need the proper
> connect string for SQLDB('mssql://...'), in web2py'd db.py.
>
> I am connecting via VPN to my office network so:
> a) I see my MSSQL server as 192.168.1.32
> b) let's just say my user is "sa" and the password is "pswd"
> c) the MSSQL database name is "mssql" (on the server)
> d) the port is 1433 for mssql
>
> Do I use any of my ODBC defs from /Library/ODBC or /usr/local/
> etc/freetds.conf (see below) - or do I access directly via an IP
> and the actual db name? I think I've tried both properly. I've tried
> too many variations and always get as follows:
>
> Traceback (most recent call last):
> File "/Users/kgingeri/web2py/gluon/restricted.py", line 62, in
> restricted
> exec ccode in environment
> File "/Users/kgingeri/web2py/applications/itca_mssql/models/db.py",
> line 8, in <module>
> db=SQLDB('mssql://sa:[email protected]/mssql') # if not,
> use SQLite or other DB
> File "/Users/kgingeri/web2py/gluon/sql.py", line 549, in __init__
> self._pool_connection(lambda:pyodbc.connect(cnxn))
> File "/Users/kgingeri/web2py/gluon/sql.py", line 423, in
> _pool_connection
> self._connection=f()
> File "/Users/kgingeri/web2py/gluon/sql.py", line 549, in <lambda>
> self._pool_connection(lambda:pyodbc.connect(cnxn))
> Error: ('00000', '[00000] [iODBC][Driver Manager]dlopen({SQL Server},
> 6): image not found (0) (SQLDriverConnectW)')
>
> 'tail' of /Library/ODBC/odbc.ini:
> ...
> [ODBC Data Sources]
> MY_SERVER_NAME = TDS
>
> [RPData]
> Driver = /usr/local/lib/libtdsodbc.so
> Description = Web2Py Data
> Trace = yes
> TraceFile = /tmp/odbc.log
> Servername = sql-org
> Port = 1433
> Database = mssql
>
> 'tail' of /usr/local/etc/freetds.conf:
> ...
> #
> # SQL-ORG Server
> [sql-org]
> host = 192.168.1.32
> port = 1433
> tds version = 8.0
>
> Sorry to be a pest. I'm new to Python and Web2py so I
> won't ask for every step! I think if I can just get my data
> then I could give Web2py a good evaluation.
>
> Karl :v)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---