By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Error writing to SQL database from Access

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
-----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 discussion thread is closed

Replies have been disabled for this discussion.