Hello,
I've converted an Access 2.0 Database to 97 and now the import function doesn't work properly anymore... (under 2.0 it works fine)
The current vba-code I use for importing a (no-extension) file into a table named "data":
--------------------------------------------------------------------
Dim strfile as String
On Error GoTo Err_cmdimport_Click
Msg = "Please specify the file to import"
Title = "Import file"
strfile = Imputbox (Msg, Title, "C:\")
If Strfile = "" then Exit Sub
Open strFile for Input As #1 'check if path exists
Close #1
docmd.transfertext , "data-import", "data", "C:\filename"
Err_cmdimport_Click:
Msgbox Err.Description
Close
---------------------------------------------------------------------
After the transfertext command the code goes to the 'Err_cmdimport_Click:' and I get a messagebox (no error-code) which says "Cannot update data. The Database or object is read-only". However, the database or the textfile aren't both read-only... (neither is the table "data") What could possibly go wrong while it worked fine under 2.0 ? By the way, I've tried several variations on the Tranfertext command without any result.
Any help will be greatly appreciated!
I've converted an Access 2.0 Database to 97 and now the import function doesn't work properly anymore... (under 2.0 it works fine)
The current vba-code I use for importing a (no-extension) file into a table named "data":
--------------------------------------------------------------------
Dim strfile as String
On Error GoTo Err_cmdimport_Click
Msg = "Please specify the file to import"
Title = "Import file"
strfile = Imputbox (Msg, Title, "C:\")
If Strfile = "" then Exit Sub
Open strFile for Input As #1 'check if path exists
Close #1
docmd.transfertext , "data-import", "data", "C:\filename"
Err_cmdimport_Click:
Msgbox Err.Description
Close
---------------------------------------------------------------------
After the transfertext command the code goes to the 'Err_cmdimport_Click:' and I get a messagebox (no error-code) which says "Cannot update data. The Database or object is read-only". However, the database or the textfile aren't both read-only... (neither is the table "data") What could possibly go wrong while it worked fine under 2.0 ? By the way, I've tried several variations on the Tranfertext command without any result.
Any help will be greatly appreciated!
Last edited: