Connect to an Access database How to connect to an Access database

        <%
        Function Incdb_GetConnection( sConnString )
        Dim oConn

        Set oConn = Server.CreateObject("ADODB.Connection")
        oConn.Open sConnString
        Set Incdb_GetConnection  = oConn
        End Function
        %>
The code to connect to a database is actually pretty easy, when you have figured out how your connection string should look like. Read more about connection strings here. Be sure to save this function in a general include file, called maybe incdb.asp and have all your other pages include that file. Usage example:
        <%
        OPTION EXPLICIT
        %>
        
        <%
        Dim oConn, sConnString
        sConnString = Incdb_GetConnectionString( 0 )
        Set oConn = Incdb_GetConnection( sConnString )
        %>
Information and tips