Request object, ASP 0105 (0x80004005) An array index is out of range.

S

steve_jackson

I get this error, when I am trying to update a table in an Access DB
through our intranet.

Here is the section of code that is generating the error:

FormItemID = Request.Form("FID")
StoreNo = Request.Form("STNO")
OrderQty = Request.Form("OQTY")

%>
<%
strDBPath = Server.MapPath("\Databases\FirmOrder.mdb")
set cnnSimple = Server.CreateObject("ADODB.Connection")
cnnSimple.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
strDBPath & ";"

For i=1 to Request.Form("OQTY").Count

' IF Request.Form("OQTY" & i) <> "" THEN

mySQL = " INSERT INTO tblFIRMORDER (FormItemID, StoreNo, OrderQty)
VALUES"
mySQL = mySQL & " (" & Request.Form("FID")(i) & ", '" &
Request.Form("STNO")(i) & "', " & Request.Form("OQTY")(i) & ")"
cnnSimple.execute(mySQL)

Can anyone tell me why I am getting the error, and how do i fix it? I
can find alot of references to ASP 105 is an array out of range but
what does that mean and how do I fix it?

Thanks,
OkieMan
 
S

steve_jackson

SORRY, the error occurs in the line of code that starts with:
mySQL=mySQL &
3rd row from the last on the post.

OkieMan
 
B

Bob Barrows [MVP]

I get this error, when I am trying to update a table in an Access DB
through our intranet.

Here is the section of code that is generating the error:

FormItemID = Request.Form("FID")
StoreNo = Request.Form("STNO")
OrderQty = Request.Form("OQTY")

%>
<%
strDBPath = Server.MapPath("\Databases\FirmOrder.mdb")
set cnnSimple = Server.CreateObject("ADODB.Connection")
cnnSimple.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
strDBPath & ";"

For i=1 to Request.Form("OQTY").Count

' IF Request.Form("OQTY" & i) <> "" THEN

mySQL = " INSERT INTO tblFIRMORDER (FormItemID, StoreNo, OrderQty)
VALUES"
mySQL = mySQL & " (" & Request.Form("FID")(i) & ", '" &
Request.Form("STNO")(i) & "', " & Request.Form("OQTY")(i) & ")"
cnnSimple.execute(mySQL)

Can anyone tell me why I am getting the error, and how do i fix it? I
can find alot of references to ASP 105 is an array out of range but
what does that mean and how do I fix it?
You verified that OQTY contained multiple values, but you never verified
that STNO contained the same number of values.
 
D

Daniel Crichton

Bob wrote on Fri, 26 Jan 2007 16:20:18 -0500:
You verified that OQTY contained multiple values, but you never verified
that STNO contained the same number of values.


Or FID ;)

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top