-dsn (-dsn)
Previous Topic  Next Topic 

Category:

 

Database Connectivity

 

Description: 

 

Specifies a Data Source Name (DSN) that is used to import email addresses from a database. A data source name is created by using the ODBC manager in the Windows Control Panel. Alternately, you can specify ODBC driver parameters directly (see examples). 

 

Optional?

 

Yes.

 

Overrides:

 

None.

 

Overridden By:

 

None.

 

Other Parameters Required:

 

-to -from -server

 

See Also:

 

Getting addresses from the database: -dbemailcolumn -dbusecolumnindex -dbquery -dbuseaddressee -dbtable

Personalizing the generated email messages: -dbreplacementids -personalize -dbconstants

Other:  -dbupdatequery

 

Usage:

 

-dsn "<DSN name>"

 

or

 

-dsn "<ODBC driver parameters>"

 

Examples (cut-and-paste right into your batch file):

 

Example #1: To Import a Microsoft Access Database with direct specification of ODBC driver parameters:

 

NetMailBot -dsn "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\temp\dsn\MyAccessDatabase.mdb" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

 

Example #2: To Import a Microsoft Excel Spreadsheet with direct specification of ODBC driver parameters:

 

NetMailBot -dsn "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\temp\dsn\MyExcelSpreadsheet.xls; Extended Properties=Excel 8.0;" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test" 

 

Example #3: To Import using a DSN (the DSN was set up via the ODBC Manager):

 

NetMailBot -dsn "MyDatabase" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test" 

 

Comments:

 

See the How to Set Up a DSN topic for more on DSNs.