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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Records in dbf table using ASP/VB script in WinNT

Status
Not open for further replies.

pengprog

Programmer
Jul 16, 2002
25
US
Hello,
I am trying to make an ASP application and need to be able to not only read, but also Write/Update to my Dbase tables. They are Dbase 5 and I am using VB Script. I use to test my application on Win XP and everything went fine with reading and writing, now I changed everything to Windoes NT and everytime there is a place where I need to write or update a record, I get an error message that says:

[Microsoft][ODBC dBase Driver] The database engine could not lock table 'table#dbf' because it is already in use by another person or process.

I checked all the connections or my table and users who could possibly be connected to my table but NONE are! Help please!!!

Ray
 
Is this a problem with your app trying to do multiple locks on the same file(s)? Or did you forget to release the lock before locking onto the file again? Another thing to check out is to see if you are using the native dBase driver for NT.
Good luck and happy debugging,
BKtechie
 
Hmm I might have forgotten to close a lock table but how do I make sure it is closed? I have put in the code to close the record set but I still get the same error. How do I know it is definitely closed? And also what is the native dBase driver for NT?

This is what I use to open the connection

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")objConn.ConnectionString="Driver= {Microsoft dBASE Driver (*.dbf)};" & _
"Dbq=" & DBLocation

Here is where i open the Recordset:

Set RS = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM bemima.dbf WHERE UNAME = '" & user_name & "' AND MIMA = '" & pass_word & "'"
RS.Open sql, objConn, , adLockOptimistic

Any help BKTechie?
 
First, define a DSN in ODBC. That will make your life a heck of a lot easier.
Second, make sure your code closes the connection and the recordset when its done with the process.
Hope this helps,
BKtechie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top