473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Make ImportError Tables go away

Nathan H
104 100+
Is there a way to make it so Access does not create an import errors table if there are problems? I am handling import errors via another method, but these tables being auto generated are causing headaches, especially after several months they begin to stack up.

Thanks in advance
Dec 7 '07 #1
6 7086
Jim Doherty
897 Expert 512MB
Is there a way to make it so Access does not create an import errors table if there are problems? I am handling import errors via another method, but these tables being auto generated are causing headaches, especially after several months they begin to stack up.

Thanks in advance
Hi Nathan,

You might want to consider looping through the table defs on opening of the database or some other 'relevant' point to determine if any exist and if so delete them. You can base the the logic for that on the table name having 'ImportErrors' contained in the name of the table to take into account the incremental naming nature of access for successive import errors.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Function DeleteImportErrors()
  3. Dim DB As DAO.Database
  4. Dim T As DAO.TableDef
  5. Dim TName As String
  6. Dim I As Integer
  7. Set DB = CurrentDb()
  8. For I = 0 To DB.TableDefs.Count - 1
  9.      Set T = DB.TableDefs(I)
  10.      TName = T.Name
  11.      If InStr(TName, "ImportErrors") > 0 Then
  12.      DoCmd.DeleteObject acTable, TName
  13.      End If
  14. Next I
  15. End Function
  16.  
Regards

Jim :)
Dec 7 '07 #2
Nathan H
104 100+
Awesome! Thanks Jim...worked like a dream. I put it on the splash screen as on on open event so it will start fresh each session.

Thanks again!
Dec 7 '07 #3
Jim Doherty
897 Expert 512MB
Awesome! Thanks Jim...worked like a dream. I put it on the splash screen as on on open event so it will start fresh each session.

Thanks again!
You're welcome

Jim :)
Dec 7 '07 #4
ADezii
8,834 Expert 8TB
Is there a way to make it so Access does not create an import errors table if there are problems? I am handling import errors via another method, but these tables being auto generated are causing headaches, especially after several months they begin to stack up.

Thanks in advance
Expand|Select|Wrap|Line Numbers
  1. Dim tdf As DAO.TableDef
  2.  
  3. For Each tdf In CurrentDb.TableDefs
  4.   If InStr(tdf.Name, "ImportErrors") > 0 Then
  5.     CurrentDb.TableDefs.Delete tdf.Name
  6.   End If
  7. Next
Dec 7 '07 #5
ADezii
8,834 Expert 8TB
Hi Nathan,

You might want to consider looping through the table defs on opening of the database or some other 'relevant' point to determine if any exist and if so delete them. You can base the the logic for that on the table name having 'ImportErrors' contained in the name of the table to take into account the incremental naming nature of access for successive import errors.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Function DeleteImportErrors()
  3. Dim DB As DAO.Database
  4. Dim T As DAO.TableDef
  5. Dim TName As String
  6. Dim I As Integer
  7. Set DB = CurrentDb()
  8. For I = 0 To DB.TableDefs.Count - 1
  9.      Set T = DB.TableDefs(I)
  10.      TName = T.Name
  11.      If InStr(TName, "ImportErrors") > 0 Then
  12.      DoCmd.DeleteObject acTable, TName
  13.      End If
  14. Next I
  15. End Function
  16.  
Regards

Jim :)
Hello Jim, not trying to step on your toes, but just offering an alternative approach.
Dec 7 '07 #6
Jim Doherty
897 Expert 512MB
Hello Jim, not trying to step on your toes, but just offering an alternative approach.
Feel free Dez.....

For i believe that For each loop
.....there is a way lol :))
Neeeeext!!

Jim :)
Dec 8 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Carsten Gehling | last post by:
Figured out myself - I just removed the line with "from url import Url" -it doesn't seem to be used anywhere ;-) - Carsten > -----Oprindelig meddelelse----- > Fra:...
2
by: x-herbert | last post by:
Hi, I have a small test to "compile" al litle script as a WMI-Tester. The script include a wmi-wrapper and "insert" the Win32-modeles. here the code: my "WMI-Tester.py" ----- import wmi
0
by: Wicked | last post by:
Hi all, Has anyone got rpm.py? Is this a class/module for Python? I am getting the following error: File "./extra/scripts/update_release.py", line 42, in ? import rpm ImportError: No...
0
by: M. Lavasani | last post by:
Hi I am trying to test Python-2.3. Any solution for this problem please: >>>gmake test case $MAKEFLAGS in \ *-s*)...
1
by: bbrazeau | last post by:
I have a database mdb. that I've made a mde. file out of. When I try to run the file I get a can't make changes requested, would create duplicate values error. Now for the facts: The open event on...
7
by: Joe | last post by:
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource (using Oracle ODBC drivers). After linking the tables in Access, I inspect the data contained in the linked tables. For...
6
by: Ian Boyd | last post by:
Every time during development we had to make table changes, we use Control Center. Most of the time, Control Center fails. If you try to "undo all", it doesn't, and you end up losing your identity...
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
9
by: Mourad | last post by:
Hi All, Is it possible to create a Make Table query in access (2.0 and 2003) that creates the table into a SQL Server database? Following the steps: 1- Create New Query 2- Set Query Type as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.