Forum Moderators: open
Thanks in advance
Set objConnect = Server.CreateObject( "ADODB.Connection" )
objConnect.Open( "DSN-Name" )
Unless you are using the DB for other purposes (an application and web, etc), I would recommend doing a straight connection. Contrary to popular belief, there is no real performance between DSN and DSNless when using Access. This will give you a connection for access directly --
Set objConnect = Server.CreateObject( "ADODB.Connection" )
objConnect.Open( "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath( "/path/to/db.mdb" ) )
(These samples are in VBScript, not JScript, incidentally. JScript is usually not recommended for use in ASP in most instances.)