People,
I need an answer on this one quickly.
I have a webiste where users upload data and it is comming back with the dredded 80004005 Error. To be spcific:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] The database engine could not lock table 'JOBS' because it is already in use by another person or process.
/_scriptuploadjobs.asp, line 56
The Script is as follows:
Dim DB_SRC_CONN
Dim rsSrc
Dim query
If (Request("run")="true") Then
Set rsSrc = Server.CreateObject("ADODB
.Recordset
")
DB_SRC_CONN = "Provider=Microsoft.Jet.OL
EDB.4.0;Da
ta Source=" & GLOBAL_ROOT &"\database\UltraDev4.mdb"
Response.Write("Making table copies. Please wait...<br>")
'---- COPY jobs -----
query = GetTableColumns( aPCColumns, "JOBS")
' Get source table
rsSrc.ActiveConnection = DB_SRC_CONN
rsSrc.Source = query
rsSrc.CursorType = 0
rsSrc.CursorLocation = 2
rsSrc.LockType = 3
rsSrc.Open()
Call createTable(rsSrc, aPCColumns)
rsSrc.Close
Response.Write("JOBS table is copied.<br>")
Function createTable( ByRef rsOld, aColumns )
'On Error Goto Err
Dim intX
Dim strTable
Dim rsNew
Dim cnNew
Set rsNew = Server.CreateObject("ADODB
.Recordset
")
Set cnNew = Server.CreateObject("ADODB
.Connectio
n")
cnNew.Open DB_CONN
'set table name
strTable = rsOld.Fields.Item(0).Prope
rties.Item
("BASETABL
ENAME").Va
lue
intX = 0
'deletes if table exists...comment this
' line if you -
'dont want the existing table to be dele
' ted
'On Error Resume Next
If (Request("append") = "") Then
Response.Write("Replacing Data (Not Appending!)...<br>")
cnNew.Execute "Drop table [" & strTable & "]" '<------ LINE 56
'create table
cnNew.Execute "Create table [" & strTable & "]"
While intX < rsOld.Fields.Count
With rsOld.Fields.Item(intX)
cnNew.Execute "Alter table " & strTable & " Add Column [" & .Name & "] " & dataType(.Type)
intX = intX + 1
End With
Wend
Else
Response.Write("Appending Data...<br>")
End If
ALL WINDOWS SECURITY SETTINGS ARE CORRECT. I have given full access to the whole directory for the Everyone group (for testing), and to the TEMP directories. Is there something I have to set in Acess to give permissions for the tables?
Is there anything else i am missing?
Regards,
Dan
Start Free Trial