DSN/DSNless ODBC Connection
Posted on: April 3rd, 2008 by adminOpening a database is straight forward. For the most part you only need to use the same code which i normally leave in an include directory.
ODBC/DSN Database Connection
var dbSub = new ActiveXObject(”ADODB.Connection”) ;
dbSub.Open( “dsn=my_dsn_name;uid=my_name;pwd=my_password;”);
ODBC/DSNless Database Connection
var dbSub = new ActiveXObject(”ADODB.Connection”) ;
dbSub.Open( “Driver={SQL Server};Server=srv\\myinst; Database=mydb;UID=me;PWD=mypw;”);
Using a DSNless connection is fine (and quicker) if you have one production/development environment. However, it is always a good idea to use DSN’s as the code doesent change if you move between databases. This is all taken care of by the system administrator.

