Sample ODBC Connection Strings and Queries

 

MS SQL      

Driver={SQL Server};Server=lmtest;Database=lmdb;Uid=sa;Pwd=pass

  

Oracle      

DSN=DSN_Name;Server=lmtest;Uid=lmuser;Pwd=pass

 

MySQL For Unix:      

Driver={MySQL ODBC 3.51 driver};server=lmtest;database=lmdb;uid=mysqluser;pwd=pass;

 

MySQL for Windows:

Driver={MySQL ODBC 3.51 driver};server=lmtest;database=lmdb;uid=mysqluser;pwd=pass;

 

PostgreSQL      

DRIVER={PostgreSQL};SERVER=lmtest;DATABASE=lmdb;UID=lmuser;PWD=pass;

 

Sample Connection Using DSN

If your driver uses DSN, the connection information in the odbc.ini file will be used to authenticate and connect to the database. No connection string is required; instead, indicate the Data Source Name. Example:

 

DSN=mysql

 

Sample odbc.ini File

[ODBC Data Sources]
[mysql]
Driver = /usr/lib/libmyodbc3.so
Description = MySQL on lmtest
SERVER = lmtest
USER = lmuser
Password = pass
OPTION = 3

 

 

Sample Select Query

This query is connecting to a table called info. The state field has been added to the ListManager Members_ table.

 

select info.email as EmailAddr_,
info.status as MemberType_,
info.state as state
from info

 

Important Query Notes

    You must have permission to view the table in the query. If you do not have permission, you will see the following error message when you test the database connection:
  
Test failed because of the following error:
If SQL query does not contain EmailAddr_ field, then it must contain both UserNameLC_ and Domain_ fields.

    The query must be a select query. Update, insert, and Delete queries will generally not work.

    Please test your query thoroughly before putting it into production.

    Do not update the password_ field. The ListManager password_ field is encrypted.

More

1.   ODBC

1.   ODBC on Unix

2.   ODBC on Windows

3.   Sample ODBC Connection Strings and Queries

2.   Database Connections

1.   New Database Connection



ODBC on Windows Clustering ListManager