Solved

Why do I get "System Resource exceeded" when I linked second & successive Excel tables

Posted on 2004-04-23
3
1,503 Views
Last Modified: 2007-12-19
Public Sub Per_VatCodeData(ByVal Period As Long, ByVal CoyCode As String, ByVal VatCode As String, ByVal VatBook As String)

Dim tdfLink As TableDef
I need to use SQL to append data to a series of Excel sheets which I was trying to link to an Access MDB using the following fragment of code in a repeatedly executed Sub:
****************************
Set tdfLink = CurrentDb.CreateTableDef("tblVatSheet")
tdfLink.Connect = "Excel 8.0;DATABASE=" & VatBook
tdfLink.SourceTableName = VatCode & "dyn"
CurrentDb.TableDefs.Append tdfLink         <------------------------------------------------ Stops here

str = Xql_RecordSet(VatCode)
DoCmd.RunSQL str

Set tdfLink = Nothing
CurrentDb.TableDefs.Delete "tblVatSheet"
*************************
Unfortunately, although it works once, it subsequently stops with the error 3035 and message "System Resource exceeded".
Am I doing something wrong? Does anyone have a solution? This should be the fastest way of doing what I wish, if only .....

Thanks
0
Comment
Question by:TonyWootton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Accepted Solution

by:
phileoca earned 100 total points
ID: 10901507
0
 

Author Comment

by:TonyWootton
ID: 11396475
Hi phileoca,

Although I am grateful for your response and I've looked at both the questions you refer to, whilst the error message I get is the same, I don't think that the cause is. Since I asked it, I've tried linking all of the sheets before populating them. That worked for all 22. I am then able to write to the first attached sheet, but then to no others. I am subsequently unable to even open any of the attached sheets, least of all to write to them. My suspicion is that there is some kind of problem with the DAO/ODBC mechanism, though I have no idea what and I have been unable to find away to correct it.

I therefore tried another route, by using automation to make Access control Excel which then sucks data out of Access. A somewhat roundabout route, except that it works quite quickly until Excel doesn't quite terminate properly (see Q_21029622.html). Fortunately I've found a workaround


0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

623 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