R
Rod
I get a:
Run-time error '3052' File sharing lock count exceeded. Increase
MaxLocksPerFile registry entry
when I rung this code:
Private Sub btnFixDNC_Click()
'Determine & assign the proper number AREA_CODE
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strPrefix As String
Dim strNumber As String
Dim strData As String
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT RecOrder, DNCData, Number " & "FROM
tblDNCRawData ORDER BY RecOrder")
With rs
.MoveFirst
Do Until .EOF
strData = .Fields("DNCData")
'If Len(strData) = 10 Then
If Len(strData) = 14 Then
strPrefix = Mid(strData, 2, 3)
'strNumber = strData
strNumber = strPrefix & Mid(strData, 7, 3) & Mid(strData, 11, 4)
Else
'strNumber = strPrefix & strData
strNumber = strPrefix & Left(strData, 3) & Mid(strData, 5, 4)
End If
.Edit
.Fields("Number") = strNumber
.Update
.MoveNext
Loop
.Close
End With
Set rs = Nothing
Set db = Nothing
'Replace the old tblDNC data with the newly formatted data from
tblDNCRawData
CurrentDb.Execute "delete * from tblDNC", dbFailOnError
CurrentDb.Execute "insert INTO tblDNC (DNCNumber) select Number from
tblDNCRawData", dbFailOnError
End Sub
Can someone please explain what this means and show me how to resolve it?
Thanks in advance.
Rod
Run-time error '3052' File sharing lock count exceeded. Increase
MaxLocksPerFile registry entry
when I rung this code:
Private Sub btnFixDNC_Click()
'Determine & assign the proper number AREA_CODE
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strPrefix As String
Dim strNumber As String
Dim strData As String
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT RecOrder, DNCData, Number " & "FROM
tblDNCRawData ORDER BY RecOrder")
With rs
.MoveFirst
Do Until .EOF
strData = .Fields("DNCData")
'If Len(strData) = 10 Then
If Len(strData) = 14 Then
strPrefix = Mid(strData, 2, 3)
'strNumber = strData
strNumber = strPrefix & Mid(strData, 7, 3) & Mid(strData, 11, 4)
Else
'strNumber = strPrefix & strData
strNumber = strPrefix & Left(strData, 3) & Mid(strData, 5, 4)
End If
.Edit
.Fields("Number") = strNumber
.Update
.MoveNext
Loop
.Close
End With
Set rs = Nothing
Set db = Nothing
'Replace the old tblDNC data with the newly formatted data from
tblDNCRawData
CurrentDb.Execute "delete * from tblDNC", dbFailOnError
CurrentDb.Execute "insert INTO tblDNC (DNCNumber) select Number from
tblDNCRawData", dbFailOnError
End Sub
Can someone please explain what this means and show me how to resolve it?
Thanks in advance.
Rod