OdbcPmWiki
Solution
A module called odbcPmWiki that allows you to use SQL statements in a wiki page to query a odbcSQL database and display the results with a table.
Installation on Linux
- install and activate your odbc software
unixODBC,freetds, php-odbc modules
- configure your ODBC-connect (the hardest work)
freetds.conf/odbcinst.ini/odbc.ini
- test this connection with something like
echo "select * from dbo.ExchangeSRV_Prefs" | isql <dsn> <user> <passwd>
Add this script to your "local" directory:
Include it in config.php with:
$odbcPMWiki_dsn = 'msdsn'; $odbcPMWiki_Username = 'user'; $odbcPMWiki_Password = 'secret'; $odbcPMWiki_TableFmt = 'class=\'tabtable\''; include_once('cookbook/odbcpmwiki.php');
explanation of the variables:
- $odbcPMWiki_dsn
- the DSN of the ODBC-Connection
- $odbcPMWiki_Username
- username to access the ODBC-Connection
- $odbcPMWiki_Password
- password to access the ODBC-Connection
- $odbcPMWiki_TableFmt
- formatting for the table tag (default is "border='1'")
The last variables is optional. All others must be set for odbcPmWiki to work.
Description
This is a quick hack to access a MS-SQL from a Linux box. I created this receipt because the other ones where to complex and did not run in my installation. This is a transcription of the Receipt MyPmWiki from mySql to a odbc-Connection.
Usage
(:odbcPmWiki SQL statement:)
Example
Release notes
- 2009-10-01
- The first running Version
See also
MyPmWiki, SelectQuery, DataQuery
Contributors
Comments
See discussion at OdbcPmWiki-Talk?
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.