Do you mean using ASP code?.
Use ADO to connect to database. Use ado connection object to connect to sql server using OLEDB connection string.
Provide the server and database details in the connectionstring parameter.
If this is what you are looking for and you need sample code then let me know.