Вторник, 30 Сентября 2014 г. 20:03
+ в цитатник
Здравствуйте.
Код из примера Access 2002 Desktop Developer's Handbook ch03 (модуль basTestTextFile):
Private Sub cmdFileTest_Click()
On Error GoTo HandleError
Dim objfile As TextFile2
Dim cLines As Long
Dim strOut As String
' Create new instance of TextFile class
' and set the Path property
Set objfile = New TextFile2
objfile.Path = "C:\AUTOEXEC.BAT"
' Open the file and print each line
' using the Lines collection
Dim varLine As Variant
If objfile.FileOpen() Then
For cLines = 1 To objfile.Lines.Count
strOut = strOut & vbCrLf & objfile.Lines.Item(cLines).Text
Next cLines
If Len(strOut) > Len(vbCrLf) Then
strOut = Mid(strOut, Len(vbCrLf) + 1)
End If
Me!txtDisplay = strOut
' Loop backward through the collection
' and remove lines with no text (Len = 0)
For cLines = objfile.Lines.Count To 1 Step -1
If Len(objfile.Lines.Item(cLines).Text) = 0 Then
objfile.Lines.Remove cLines
End If
Next cLines
' Save the file
objfile.FileSave
' Close the file
objfile.FileClose
End If
ExitProc:
Exit Sub
HandleError:
MsgBox "Error: " & Err.Description & _
" (" & Err.Number & ")", vbExclamation, "Test TextFile2 Class"
Resume ExitProc
End Sub
Вопрос: В Access 2003 работает прекрасно, а в Access 2013 появляется ошибка Error75.
Существует ли решение?
http://www.sql.ru/forum/1118455/kak-ispravit-oshibku
-
Запись понравилась
-
0
Процитировали
-
0
Сохранили
-