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

ERROR: Could not update; currently locked by user 'Admin' on machine..

Status
Not open for further replies.

bburch

Programmer
May 23, 2002
1
US
I am currently developing a program to parse the information from a flat file (a report) into 3 tables of an Access database. The flat file is about 9 megs. Two tables consists 6 fields and 12 fields of text, date, and currency. The third table has 2 fields; number and memo. This table is to contain the page number and the page contents from the report (1897 pages). The records other two tables contain a parsed lines from the page (a record per line). I am using VB6. The program also creates the database through ADOX and enters the date by ADO.

When I open the database, I use "User=Admin" in the open statement. The error never happens in the same place of reading the file; sometimes it at 8% completion of the reading the file; sometimes it 99%. I have put in delay statements (GetTickCount) to give the database time to get out of the lock. A high number 500 seems to abate the problem (don't occur as often) but the processing is so slow compared to the process without the delays. I have even changed the code to do the inserting by SQL inserts, but very slow.

I open the database and datasets all at once and keep datasets open thoughout the processing of the file. At the completion of the file, I close the datasets and database.

Has anyone seen this problem, and found a solution to it, could you email me? Or point me the direction of where I may find a solution.

Thanks in advance,
Brandon Burch
brandonb@co.whitman.wa.us
PS. If you do have a question/solution, also email at the above address. Thanks.
 
Brandon,
I've had similair problems with ADO updating an Access database. To get round adding in delays all over the code I set a reference to Microsoft Jet and Replication Objects, in code have DIM JRO As New Jro.JetEngine. Then after inserting rows using execute method add the line JRO.RefreshCache adoConnection.

Hope this helps.

Regards, Nick

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top