Note The Content object is included in Commerce Server 3.0 only for backward compatibility with sites created in Commerce Server 2.0. New sites should be constructed using ADOs. Connection strings (DSNs) should be stored in the ConnectionStringMap (part of the site dictionary) and queries should be stored in the QueryMap Dictionary object.
The AddDatasource method associates a configured file or system DSN with a string alias.
Content.AddDatasource(Alias, ConnectionString)
If you use more than one DSN in a site, you should specify one of them as the default DSN for the site. To do this, set the Application object's MSCSDefaultDatasource variable to reference the string variable name that you have associated with a DSN that you have added to the Content object query collection.
The following example, from the Clocktower sample site, creates a Content object, adds a DSN variable to the object, and makes that DSN the default DSN for the site:
REM Create a Content object for access to the database
Set MSCSContent = Server.CreateObject("Commerce.Content")
Call MSCSContent.AddDatasource("Clocktower", MSCSDSN)
Set MSCSDataSource = MSCSContent.Datasource("Clocktower")
' Later, in Application_OnStart
Application("MSCSDefaultDatasource") = "Clocktower"