Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database or object is read only when running macro 1

Status
Not open for further replies.

ISmonkey

MIS
Sep 6, 2001
62
FR
We converted an Access 97 database to Access 2000 and now when a certain macro runs, i get -cannot update- database or object is read only. The macro imports data (fixed width) from a text file (.dat) into a table which has no restrictions on it what so ever. When looking at the VB code in Modules, the script looks like-

DoCmd.TransferText acImportFixed, "Specification-name", "tbl_data", "d:\data.dat", False, ""

it errors out when i debug at this point. I have tried to run the Jetcomp ver 4 utility on it already, and i have tried to create a new macro with the same format. I have even imported the table data into a new table with no luck. Any suggestions (including guesses) would be helpful. >:):O>
 
Well here's a guess for what it's worth.

When you converted/upgraded the database, did your import specifications come over to the new database? Perhaps your problem is as simple as importing the specs from the old database into the new. Maq B-)
<insert witty signature here>
 
To tell the truth, i dont know how to check to see if they did convert or not! heh...
 
Well, there may be a simpler way in Access 2000, but in Access 97 I check by &quot;faking&quot; an import.

Go to the file import menu and pick a text file to import. When the import wizard pops up, click on the advanced button. This brings you to the import specifications screen. You can click &quot;specs&quot; to bring up a list of current specs in the database. If your spec isn't listed then you can use this screen to create it.

If you don't want to spend time re-creating it, then import it from your old database. Maq B-)
<insert witty signature here>
 
GOT IT! When i went to import, i noticed that *.dat files were not one of the available options. I then changed the data.dat to data.txt and the macro worked like a charm. I really couldnt have done it without your suggestion. Thanks.
 
Hi,
I have an access 97 application with the following code:
DoCmd.TransferText acImportFixed, &quot;Specification-name&quot;, &quot;Daily&quot;, &quot;c:\daily.txt&quot;, False, &quot;&quot;

I am trying to create a table called &quot;Daily&quot; and populating it with data from a text file called &quot;Daily.txt&quot;

Each time the application is run, table &quot;Daily&quot; is deleted and created by the above VB code and repopulated from &quot;daily.txt&quot;(this text file is also deleted and created using a .BAT file when the program runs)

This program runs perfectly in Access 2000 but gives an error of shut down after illegal operation in Access 97.

I have gone through posted messages by user &quot;DSpence&quot; and answers by &quot;Maquis&quot; but it didn't help.

Please help!
 
Hi I want to transfer data from a text file to a table but i don't know how to get a specification argument for a fixed width data. I tried all the ways that u mentioned here but couldn't find anything like &quot;specs&quot;. first please tell me when do i have to goto file menu, when the macro is opened or .... please answer my question as soon as possible
 
mmdhar88,

Please post your question in a new thread. People are more llikely to answer.

Thanks, Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains &quot;Suggestions for Getting Quick and Appropriate Answers&quot; to your questions in the SQL Server forum. Many of the ideas apply to all forums.
 
the 'database or object is read only' error occurs when you try to import a file with an unautorized suffix.

If you want to autorize suffix 'dat', for example, you must edit the register, and add this suffix to this key :

hkey_localmachine/software/microsoft/Jet/4.0/engine/text/DisabledExtensions

wich commonly contains in fact a list of 'not disabled' extensions with a '!' (negation) before.
if you have :
!txt,csv,tab,asc,htm,html
simply write :
!txt,csv,tab,asc,htm,html,dat

Yffic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top