Originariamente inviato da Santino83_02
allora, per precisione:
codice:
function opeConnection(theConn, strConnessione)
set theConn = server.createObject("ADODB.Connection")
theConn.open strConnessione
end function
visto che lui la vuole aprire su database diversi
codice:
function opeConnection(theConn, thePath)
set theConn = server.createObject("ADODB.Connection")
theConn.open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.maPath(thePath)
end function
function closeConnection(theConn, "\db\prova.mdb")
theConn.close
set theConn = nothing
end function
call openConnection(conn)
sql = "SELECT * FROM tabella1"
set rs = conn.execute(sql)
call closeConnection(conn)