"I/O error, pervasive status code 46"

I  have a user who while in Timberline Accounts payable module receives an "I/O error, pervasive status code 46" almost daily.  
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill BachPresident and Btrieve GuruCommented:
A status 46 is "unable to write to file".  The most common causes are:

- Having ReadOnly access rights to the file.
- Having a file flagged ReadOnly.
- Accessing a Btrieve 5.x file with Pervasive PSQL v9 or newer.
- Opening a file who's access has been compromised by another application.

The first three are easy enough, so let me explain the last one.  If you have multiple Pervasive versions on the network, it is possible that one engine will open the file and lock out other engines.  Ideally, you should ALWAYS use the same engine (preferably the one on the server) to access the database files.

Another possibility, which is more likely if the problem is random, is that an Anti-virus application is scanning the file when it is closing, and then the application tries to re-open it again.  Since the file is in use for the duration of the scan, the database engine only gets ReadOnly access rights when it tries to access it.  Change your AV program to NOT scan database files.

A third possibility is that they are running a backup operation at the same time as using the files.  Backup packages often open files in "DENY_WRITE" mode, so that they can get a clean snapshot.  If the database tries to open the file when the backup is running, it again gets ReadOnly mode.  See www.goldstarsoftware.com/press.asp for a white paper on getting proper Pervasive backups with users in the system.

Simple Solution when it occurs:  Reboot the server.
Less intrusive solution:  Use the Pervasive Monitor to check the engine to see if the file is open in ReadOnly mode.  (Microkernel/Active Files, then check left side.)  If it is, you will see a list of users on the right side that are in the file.  Get those users out so that the file closes.  Then, allow those users back in.

The PSConfig tool (www.goldstarsoftware.com/psconfig.asp) has an automatic feature that can clear all users who have a given file open, which would automate this process for you for PSQL2000i and newer databases.  However, it sounds like you just need to know how to prevent it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rlstewartAuthor Commented:
Couple conclusions we have come to.  We had the user log in through Citrix and didnt get this error.  She also prints to file first now and then goes and prints her reports without the error.  Could it have been some sort of print issue where the file she was printing to was seeing her as trying to write to a read only file?
Bill BachPresident and Btrieve GuruCommented:
After changing multiple parameters to the problem, you cannot determine which change fixed it.  Could be the use of the Citrix box.  Could be rights of the logged in user.  Could have been conflict with an older Btrieve/Pervasive engine on the workstation.  Could have been related to printing (though I doubt it).

You'd have to go back to the original situation, duplicate the issue, and the change ONE variable at a time to really figure it out.  If it's working now, it's probably not worth worrying about.
rlstewartAuthor Commented:
We have her going though Citrix and printing to file as a workaround but not as a fix.  I would still like to know if its a printer issue or the Btrieve.

Bill BachPresident and Btrieve GuruCommented:
Status 46 is definitely a Btrieve issue.  Of course, the application could be sending temporary data to a Btrieve file WHILE printing and getting the 46.  Duplicate the problem, then see "less intrusive solution" above and start there.  Let me know what you see.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Enterprise Software

From novice to tech pro — start learning today.