Ask for explanation

Hello everybody,

I made a lot of aplications in ASP+Access combination. I always used something like this:

For preparing connection and to open DB:

set cn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
' Customize - Start
db = Server.MapPath("../database/dhalia2.mdb")
' Customize - Stop
cs = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & db & ";"
cn.Open cs

To close connection:

set rs = Nothing
set cn = Nothing

To execute some SQL, prepare some SQL query in sSQN variable and:

Set rs = cn.Execute(sSQN)

But I know it exist other way to execute SQL and I think it is more powerful because additional parameters when You open Qyery like:

rs.Open sSQN, cn, adOpenStatic, adLockPessimistic

Can somebody explain to me difference between this two ways and all this constants:


Thanks a lot.



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!