'File access is denied' error when working with Kaspersky Pure

Hi,
Recently I bought the antivirus software Kaspersky Pure and my applications (VFP 9.0 SP2) begin generating errors 'File access is denied' (refering to DBF files) when in the program there is a code including 'ALTER TABLE ...'.
I moved all the application folder, including database folder in the 'Trusted zone', but nothing happened, and errors still appear.
Please help me.
Gabriela
gaby12Asked:
Who is Participating?
 
Olaf DoschkeConnect With a Mentor Software DeveloperCommented:
All I can say about ALTER TABLE is that it creates a temp table and finally deletes the old one and renames the new one. Rather looks like all that is done to the existing file, but behind the scenes two files are involved. Such things of course are suspicous operations to antivirus software.

It's time to call Kaspersky, if you checked the "do not scan opened files and do not monitor application activity checked." option already. Sometimes changes need a restart of the software or a reboot of the system.

Otherwise creating the table with the structure you finally want or working with cursors instead of temp Dbf files would be a solution.

You can use AFIELDS() instead of copy structure, change and extend the resulting array as you like and then CREATE TABLE FROM ARRAY.

Creating a cursor is even less of a hassle: Select table.*, CAST(expression AS fieldtype) as newfield from table into cursor cursorname Readwrite. Can also be as simple as SPACE(30) as newchar20field and afterwards you can fill values into the new field in a secondary scan or update etc. as you do with the temp table via Select cursorname and COPY TO dbfname. It's easy to work with a cursor like you did before with a temp dbf, you can reuse all your code.

If you want to keep a temp table to be able to repeat the last report, simply put that as last, generating files abviously poses less problems as altering them.

Bye, Olaf.
0
 
danubianCommented:
What operating system do you use ?
If the problem is NTFS permission related, then you should give modify/edit permission on tables folder to the app operators.
0
 
Olaf DoschkeSoftware DeveloperCommented:
Alter table is generating a new file temporary, kaspersky might scan that. add dbf,cdx,fpt,dbc,dct,dcx to extensions kaspersky shouldn't scan, even in the TEMP dir.

Besides that ALTER TABLE does need exclusive access and therefore is of limited use in a shared database application. You do such things as table changes as maintainance, eg as database update before/when introducing a new version, not in the daily work with a database, uness it's a single user application. But even then: A econdary form wanting to use that table while it's altered can fail.

It might not be related to Kaspersky, but happens more often or at all, because table alterations take longer the more data there is in a dbf of course.

Bye, Olaf.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
gaby12Author Commented:
Hi danubian,
I use Windows XP on one computer and Vista on my laptop. The problem is the same, and generated by the use of the antivirus software Kaspersky Pure (when I close it all problems disappear, as they appeared after instalation of Kaspersky Pure).
0
 
gaby12Author Commented:
Hi Olaf,
I use the 'ALTER TABLE' only on a temporary DBF file, generated by a 'COPY STRUCTURE' command, and used for reports and displaying data. I know for sure that is a Kaspersky problem and I wanted to solve it faster, with your help.
Thank you,
Gabriela
0
 
GreatSolutionsC.I.OCommented:
Had the same problem with kaspersky a long time ago, tried adding .DBF to the list of allowed extensions, didn't help and it was quite a critical application, so never used them again since then.
0
 
gaby12Author Commented:
As I said previously, I put in the 'Trusted zone' the application directory, which include the fact that all files are not scanned (including the database folder, and temporary  folder).
0
 
pcelbaCommented:
Another option would be to

COPY STRUCTURE EXTENDED TO TblStru

update the resulting TblStru.DBF and create new table structure by

CREATE Tbl FROM TblStru

I would also recommend to ask same question in Antivirus software zone.

BTW, I am using AVAST and AVG without problems. (Avast just has higher ratio of false alarms.)
0
 
danubianCommented:
Try adding the app executable to trusted zone>trusted applications with do not scan opened files and do not monitor application activity checked.
0
 
gaby12Author Commented:
Sorry, I already bought the Kaspersky antivirus software, and I think that all peple who bought it finally can use it.
0
 
gaby12Author Commented:
Hi danubian, I allready did that !!!
0
 
pcelbaCommented:
AVG and AVAST was just a note. The work around is more important and antivirus independent solution...
0
 
Olaf DoschkeSoftware DeveloperCommented:
You say you excluded the temporary folder. That's a folder per user within the user profile. Despite of that it's surely one folder where viruses can prosper, as users have write and execution rights there, so excluding that from antivirus is not a good move. Excluding the file extensions of foxpro data is better.

Bye, Olaf.
0
 
Olaf DoschkeSoftware DeveloperCommented:
Here's another two voices on Kaspersky:

1. Somehow the watchguard (or whatever that is named in Kaspersky) is involved in creating new files. He opens them exclusive for a short check, probably even despite of excluded directores, which of course is a problem in ALTER TABLE and other scenarios, you can't control that and foxpro fails on that behaviour.

2. Using your own TEMP dir could be a working alternative. Foxpro is using the official TEMP dir you can see with SYS(2023) or GETENV(TEMP).

What you should change is TMPFILES, EDITWORK, PROGWORK, and SORTWORK settings in a Visual FoxPro configuration file (config.fpw). Then foxpro will not use the TEMP folder other applications use, but will use that dir also for ALTER TABLE. So eg create a folder C:\yourapp\temp\ and set foxpro to it and exclude it from Kaspersky.

That would work in regard of opinion/voice 2, but if opinion/voice 1 is correct, Kaspersky doesn't work with foxpro or vice versa.

Bye, Olaf.
0
All Courses

From novice to tech pro — start learning today.