G
Guest
Thanks for taking the time to read my question.
My DB was in 97 and it works perfectly. My company changed to 2000 and now
one part of the DB doesn't work.
I am linking 2 external text files to the program. They are text documents,
but have different file extensions (I made them up: .lnu and .pmf) This
helps me separate them when I populate a combo box, as well as a few other
functions.
Now in 2000 I can no longer link the files. How can I fix this?
The Error I get is 3027: Cannot Update. Database or Object is Read-Only
Here is my code:
Function DeleteLNUViewingCopy(FilePath As String, FileName As String)
Dim TheFileAndPath, TheFileAndPathDest As String
Dim x, y As Integer
On Error GoTo DeleteLNUViewingCopy_Err
If Right(FilePath, 1) = "\" Then
TheFileAndPath = FilePath & FileName
Else
TheFileAndPath = FilePath & "\" & FileName
End If
x = Len(FileName)
y = Len(TheFileAndPath)
If x = 0 Then Exit Function
TheFileAndPathDest = Left(TheFileAndPath, y - x) & "LNUViewingCopy" &
Left(Right(TheFileAndPath, x), x - 3) & "txt"
Kill TheFileAndPathDest
DeleteLNUViewingCopy_Exit:
Exit Function
DeleteLNUViewingCopy_Err:
If Err.Number = 53 Then
Resume DeleteLNUViewingCopy_Exit
Else
MsgBox Err.Number & ", " & Err.Description
Resume DeleteLNUViewingCopy_Exit
End If
End Function
Thanks for your help
Brad
My DB was in 97 and it works perfectly. My company changed to 2000 and now
one part of the DB doesn't work.
I am linking 2 external text files to the program. They are text documents,
but have different file extensions (I made them up: .lnu and .pmf) This
helps me separate them when I populate a combo box, as well as a few other
functions.
Now in 2000 I can no longer link the files. How can I fix this?
The Error I get is 3027: Cannot Update. Database or Object is Read-Only
Here is my code:
Function DeleteLNUViewingCopy(FilePath As String, FileName As String)
Dim TheFileAndPath, TheFileAndPathDest As String
Dim x, y As Integer
On Error GoTo DeleteLNUViewingCopy_Err
If Right(FilePath, 1) = "\" Then
TheFileAndPath = FilePath & FileName
Else
TheFileAndPath = FilePath & "\" & FileName
End If
x = Len(FileName)
y = Len(TheFileAndPath)
If x = 0 Then Exit Function
TheFileAndPathDest = Left(TheFileAndPath, y - x) & "LNUViewingCopy" &
Left(Right(TheFileAndPath, x), x - 3) & "txt"
Kill TheFileAndPathDest
DeleteLNUViewingCopy_Exit:
Exit Function
DeleteLNUViewingCopy_Err:
If Err.Number = 53 Then
Resume DeleteLNUViewingCopy_Exit
Else
MsgBox Err.Number & ", " & Err.Description
Resume DeleteLNUViewingCopy_Exit
End If
End Function
Thanks for your help
Brad