473,386 Members | 1,830 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,386 software developers and data experts.

Error writing to SQL database from Access

Greetings,

I am developing an application that writes values from an Access 2000
database to an SQL 7.0 server using DAO and linked tables. It seems to
work fine for the first 26 of 108 tables, but part way through the
population of the 27th table it stops and displays a 'Runtime Error
3001 Invalid Arguement' message. Not sure what to make of this.

Any help would be appreciated.

Daryl

For nZone = 1 To p_intZoneCount
If p_bRunZones(nZone) Then
Debug.Print "Writing zone " & nZone & "..."
With p_zneData(nZone)
nMaxRow = .MaxRow - .MinRow
nMaxCol = .MaxCol - .MinCol
For nRow = .MinRow To .MaxRow
For nCol = .MinCol To .MaxCol
rstData.AddNew
rstData!ddRow = nRow
rstData!ddcol = nCol
For nStep = 0 To SCN_STEPS
rstData("ddDensity" & nStep) =
p_intMapData(nStep, nRow, nCol)
Next nStep
rstData.Update <<BONKS HERE>>
Next nCol
Next nRow
End With
End If
Next nZone
Nov 12 '05 #1
5 1636
djharrison wrote:
Greetings,

I am developing an application that writes values from an Access 2000
database to an SQL 7.0 server using DAO and linked tables. It seems to
work fine for the first 26 of 108 tables, but part way through the
population of the 27th table it stops and displays a 'Runtime Error
3001 Invalid Arguement' message. Not sure what to make of this.

Any help would be appreciated.

Daryl

For nZone = 1 To p_intZoneCount
If p_bRunZones(nZone) Then
Debug.Print "Writing zone " & nZone & "..."
With p_zneData(nZone)
nMaxRow = .MaxRow - .MinRow
nMaxCol = .MaxCol - .MinCol
For nRow = .MinRow To .MaxRow
For nCol = .MinCol To .MaxCol
rstData.AddNew
rstData!ddRow = nRow
rstData!ddcol = nCol
For nStep = 0 To SCN_STEPS
rstData("ddDensity" & nStep) =
p_intMapData(nStep, nRow, nCol)
Next nStep
rstData.Update <<BONKS HERE>>
Next nCol
Next nRow
End With
End If
Next nZone

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

My guess is that one of the values (nStep, nRow or nCol) is NULL or the
function p_intMapData() returns a value that is not allowed in the
column ddDensity (perhaps a NULL or a number [ddDensity is a numeric
column, isn't it?] that is out of range).

Remove all error handling from the procedure that contains your code.
Run the procedure again. When the error occurs, the VBA module window
should open. You can then use the Debug Window (or cursor-hover method)
to determine the values of the above named variables.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQIXDx4echKqOuFEgEQL1GQCg/Un4HIUIeQ+S2bEWAVD1K/1lKuEAniuC
rMUOFAWTOR9Z/cXqsyEWk2Uk
=xqfF
-----END PGP SIGNATURE-----

Nov 12 '05 #2
Thanks,

I tried using the cursor-hover method and found that all the variables
were numeric and had a value of 0, which are valid. I also was able to
run the algorithm for the particular offending table only and it ran
through completely just fine! There must be something up with the fact
that it encounters an error when run as part of the larger loop
through all 108 tables?

Any other suggestions are welcome.
Thanks again.

Daryl
Nov 12 '05 #3
The error "Invalid argument" error occurs when a function/sub is called.
Where in your code does the error occur?

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
djharrison wrote:
Thanks,

I tried using the cursor-hover method and found that all the variables
were numeric and had a value of 0, which are valid. I also was able to
run the algorithm for the particular offending table only and it ran
through completely just fine! There must be something up with the fact
that it encounters an error when run as part of the larger loop
through all 108 tables?

Any other suggestions are welcome.
Thanks again.


Nov 12 '05 #4
The error get thrown at 'rstData.Update'.
Next nStep
rstData.Update <<BONKS HERE>>
Next nCol


It runs through a number of records prior to throwing an error?
Nov 12 '05 #5
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don't know what the cause of the error is. You might try
compiling/compacting the application & see if that fixes the problem.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQI1d4IechKqOuFEgEQJ97ACeN+5juQ+CnhYUCQjX+5pj6P 9yROsAoIfc
+U1h9F3bxCAIo7gn0zgX+LRQ
=gaCI
-----END PGP SIGNATURE-----
djharrison wrote:
The error get thrown at 'rstData.Update'.

Next nStep
rstData.Update <<BONKS HERE>>
Next nCol

It runs through a number of records prior to throwing an error?


Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jack | last post by:
Hi, I am trying to test a sql statement in Access which gives me the error as stated in the heading. The sql statement is built as a part of asp login verification, where the userid and password...
5
by: djharrison | last post by:
Greetings, I am developing an application that writes values from an Access 2000 database to an SQL 7.0 server using DAO and linked tables. It seems to work fine for the first 26 of 108 tables,...
3
by: Rolan | last post by:
I seem to be unable to have a custom error message to appear for Error 10011 (database was unable to append all the data to the table). Each time, the MS Access default error message box appears....
2
by: Chuck Ritzke | last post by:
Hi all, I am getting an intermittant error after uploading a project from my development machine. I click on a link which opens an aspx page that, upon page load, reads a very small amount of...
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
3
by: Steve Teeples | last post by:
I am writing my first database application. I am unable to even get to first base because I can't seem to access the data in the database. Each time the "Fill" command is executed I get an...
8
by: nishkrish | last post by:
Hi, I am new to access I created the form and report from Allen Browne's Frmwhat Date the way he has described but when i preview report it shows StartDate: name? Enddate: name? am i suppose...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.