Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Database Lock Out?

Status
Not open for further replies.

Ladyborg

Programmer
May 11, 2002
208
0
0
US
Can an Access db used on a web site NOT be locked (.ldb file) when one person is using it?

If, for example, a site is high traffic, just one person logging in would presumably lock the database so no one else would be able to log on.

ladyborg64x64.gif
Ladyborg
"Many of life's failures are people who did not realize how close they were to success when they gave up." [Thomas A. Edison]
 
The trick is to make sure the db is not open longer than neccessary. You just open the db, extract or update the data, close the db. The db would be locked briefly and only for writing.




Chris.

Indifference will be the downfall of mankind, but who cares?
 
Chris,

Thanks. How do I do that? %-)

ladyborg64x64.gif
Ladyborg
"Many of life's failures are people who did not realize how close they were to success when they gave up." [Thomas A. Edison]
 
Something like this;

ConnString = ("DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.MapPath("dbname"))' & ";")

strSQL = "select * from tablename;"
' Create and open the connection
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConnString
' Create the recordset
Set RS = Server.CreateObject("ADODB.Recordset")

RS.Open strSQL, Conn, adOpenStatic, adLockReadOnly, adCmdText

'read the data into variables
variable1 = RS.fields("fieldname")
variable2 = RS.fields("anotherfieldname")
' close recordset and connection
RS.close
set RS = nothing
conn.close
set conn = nothing

the whole operation is done in milliseconds.

you can find more info in the ASP forum333 on db connections



Chris.

Indifference will be the downfall of mankind, but who cares?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top