Need to create an ODBC conne开发者_开发百科ction to multiple databases which will allow end user to specify a unique date to pull report. The end user is currently compiling data daily into unique databases (xxxx.date) and we want to allow a non-technical end user to select the date and retrieve the most current database. How can this be done?
You can use connect string. There should be connect string you can use to connect to your database. Example from http://connectionstrings.com/postgre-sql#p51
Driver={PostgreSQL UNICODE};Server=IP address;Port=5432;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Just look how connect string to you DBMS looks like and use it.
There is example on how to use connect string including file name to MS Access database with Python:
db = pyodbc.connect('Driver={Microsoft Access Driver (*.mdb)};Dbq=Nwind.mdb;Uid=;Pwd=;')
c = db.cursor()
rs = c.execute("SELECT CategoryName FROM Categories")
...
精彩评论