Solved

Error 3320 when trying to update access table

Posted on 2014-02-25
10
898 Views
Last Modified: 2014-03-07
Experts,

I am getting this error when a macro runs which is trying to update an Access table.  (see attached). Runtime Error 3320

The statement that is failing is:

UPDATE tbl_Standard_Report a IN 'Directory\my.mdb'
 SET a.LastGenerated= #2/25/2014 10:28:33 AM#, a.Duration='00:00:41',     a.LastGeneratedBy='username'
 WHERE a.ReportID=111

Does anyone see what is wrong.  I am running someone else's code.  I did notice that the high level qualifier a is not assigned to a table.  I don't know if that could be the problem.
run-time-error.doc
0
Comment
Question by:morinia
  • 6
  • 4
10 Comments
 
LVL 84
ID: 39886056
The error seems to be coming from the database table "tbl_Standard_Report" - essentially, it's telling you that a validation rule in that table is not valid.

Can you open tbl_Standard_Report in Access, and then open it in Design view? From there, you'd have to look at the fields and see if one of them has a value specified in Validation Rule property (in the General tab).
0
 

Author Comment

by:morinia
ID: 39886297
I did notice that there are two fields for each person.  One is operator and the other is administrator.

I am thinking that administrator needs to be checked for me to update the table.  Currently only operator is checked for my name.
0
 
LVL 84
ID: 39886483
I did notice that there are two fields for each person.  One is operator and the other is administrator.
You'd have to explain that further. The error you presented is pretty straight forward (i.e. you've got troubles with a validation rule), but I don't have any idea what you mean by "administrator" or "operator". Those are not standard Access terms.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:morinia
ID: 39886508
It was just a table with users listed.  However, I am still getting the error so I am looking to find out what I do not have access to.

Thanks for your help so far.  I will let you know when I find it.  I too felt it is something with validation somewhere.
0
 

Author Comment

by:morinia
ID: 39887088
Experts,

The above listed command runs file if you run in in the SQL portion of Access.  However when executed from the same database in a macro in VB it gets the runtime 3320 error.

When the command is put into a string and run in VB (see below) that is when I get the error.

  DoCmd.RunSQL (strUpdate)
0
 
LVL 84
ID: 39888347
What version of Access is this?

If it's 2007 or higher, then be sure the database is in a Trusted Location. Code (including macros) cannot run if the database is not in a Trusted Location.

YOu can add Trusted Locations from the Access interface - open the Options dialog, click the Trusted Locations option, and then add locations if needed.

Here's more information on TLs: http://office.microsoft.com/en-us/access-help/create-remove-or-change-a-trusted-location-for-your-files-HA010031999.aspx
0
 

Author Comment

by:morinia
ID: 39907795
Experts,

I think I may have found the problem.  I am running Windows 7 and the Access Database is 2000.  All of the other databases that the same code works fine are 2003.  

I am able to update the database in Access using SQL with no problem and I can create a function in Access 2003 and update the database with no problem.

While searching the web I saw where older versions being opened with newer versions can possibly give this error.

Does anyone know the best way to convert the Access 2000 database to Access 2003?
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39907841
The default format for Access 2003 was 2000, so I'm not sure that's your problem.

Have you reviewed that table to determine what's in the validation rule? If you can post the actual rule, we might be able to determine what's going on.
0
 

Author Comment

by:morinia
ID: 39909353
Scott,

The problem is not the compatibility with Access 2000 to Access 2003.  It is that I am running in Windows 7.   Windows 7 is not compatible with Access 2000.  

My coworkers who are running Windows XP, do not have the issue.  

I will be converting the database today and will confirm if this fixes the proble.

FYI,

There were similar issues with drivers for Oracle.  The Oracle in OraClient 10_g worked fine in Windows XP, however I had to use Oracle in OraClient 11_g in Windows 7.

It is probably rare instances that an Operating System is upgraded to Windows 7 and Access 2000 databases are still being used.
0
 

Author Closing Comment

by:morinia
ID: 39912304
There may have been a problem when someone restored the database.  Yesterday, I copied the database and converted it to Access 2003.  I also did a repair.  This morning th job ran without a problem.

At this point, I am not sure what the exact problem was.  However you are correct the issue was not Access 2000 to Access 2003.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question