boscorelli
New member
- Local time
- Today, 02:30
- Joined
- Mar 19, 2007
- Messages
- 3
Hi
I am trying to import a text file into an Access 97 database using the below code. The code worked fine on Windows NT, but when I try it on Windows Xp I get the error
“Run Time error 3027. Can’t Update. Database or object is read only.” this occurs on the line commented 'error appears here
The database is still in Access 97 format on Xp.
The problem is that the files are to be imported are called for example
x.user_pid AXZ_PIDWW00BP
I have changed the registry to allow the file extension (user_pid AXZ_PIDWW00BP) but when I run the code I get an error message saying
“MS Access has encountered a problem and needs to close” and then Access crashes.
I have also tried changing the files that need to be imported to .txt files using VBA. Then I get the error message when running the below code
“Run-time error 3011 The Microsoft Jet engine database could not find the object ‘Filename’. Make sure that the object exists and that you have spelt it correctly. “
BUT, when I use VBA code to open the text file in the Excel VBA editor, the files open correctly.
I would be very grateful if any one has any ideas? I am stuck on this.
Thanks
I am trying to import a text file into an Access 97 database using the below code. The code worked fine on Windows NT, but when I try it on Windows Xp I get the error
“Run Time error 3027. Can’t Update. Database or object is read only.” this occurs on the line commented 'error appears here
The database is still in Access 97 format on Xp.
The problem is that the files are to be imported are called for example
x.user_pid AXZ_PIDWW00BP
I have changed the registry to allow the file extension (user_pid AXZ_PIDWW00BP) but when I run the code I get an error message saying
“MS Access has encountered a problem and needs to close” and then Access crashes.
I have also tried changing the files that need to be imported to .txt files using VBA. Then I get the error message when running the below code
“Run-time error 3011 The Microsoft Jet engine database could not find the object ‘Filename’. Make sure that the object exists and that you have spelt it correctly. “
BUT, when I use VBA code to open the text file in the Excel VBA editor, the files open correctly.
I would be very grateful if any one has any ideas? I am stuck on this.
Thanks
Code:
Function ImportProcessesIntoTable()
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("PossibleEnvironments", dbOpenDynaset)
rst.MoveFirst
Do Until rst.EOF
With rst
DoCmd.TransferText acImportFixed, "up_spec", "UserPid", "c:\x.user_pid" & !Envname 'error appears here
DoCmd.TransferText acImportFixed, "axzspec", "Axz_pid", "c:\x.axz_pid" & !Envname
.MoveNext
End With
Loop
rst.Close
fillTableLf
End Function