Wednesday, July 6, 2011

ODBC logon scripts - ODBCCONF

ODBCCONF is deprecated, and "should not be used", but I couldn't find a better way to do this in the time that I had.
I needed a logon script to create some data sources (ODBC's) so I used ODBCCONF in a batch file that looked like this:
ODBCCONF CONFIGDSN "SQL Server" "DSN=DataSourceName| Description=| SERVER=DBhostnameorIP| Database=DB_name| Trusted_Connection=yes"

This breaks down as follows:
ODBCCONF - The utility to run
CONFIGDSN - Configures a User DSN (CONFIGSYSDSN would be for a System DSN)
"SQL Server" - The driver to use
DSN= Data source name
Description= A description of the DSN
SERVER= DB host or IP address
Database= DB name
Trusted_Connection=yes (Use Windows NT authentication)

0 comments:

Post a Comment

 
Contact our honeypot department if you are desperate to get blacklisted.