Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

python - SqlAlchemy equivalent of pyodbc connect string using FreeTDS -


the following works:

import pyodbc pyodbc.connect('driver={freetds};server=my.db.server;database=mydb;uid=myuser;pwd=mypwd;tds_version=8.0;port=1433;') 

the following fails:

import sqlalchemy sqlalchemy.create_engine("mssql://myuser:mypwd@my.db.server:1433/mydb?driver=freetds& odbc_options='tds_version=8.0'").connect() 

the error message above is:

dbapierror: (error) ('08001', '[08001] [unixodbc][freetds][sql server]unable connect data source (0) (sqldriverconnectw)') none none

can please point me in right direction? there way can tell sqlalchemy pass specific connect string through pyodbc?

please note: want keep dsn-less.

the example @singletoned not work me sqlalchemy 0.7.2. sqlalchemy docs connecting sql server:

if require connection string outside options presented above, use odbc_connect keyword pass in urlencoded connection string. gets passed in urldecoded , passed directly.

so make work used:

import urllib quoted = urllib.quote_plus('driver={freetds};server=my.db.server;database=mydb;uid=myuser;pwd=mypwd;tds_version=8.0;port=1433;') sqlalchemy.create_engine('mssql+pyodbc:///?odbc_connect={}'.format(quoted)) 

this should apply sybase well.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -