Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

1+1 = 3 in IE 5.5 only

Status
Not open for further replies.

northernbeaver

Programmer
Jul 9, 2001
164
CA
I have a form that ties into an Access 2000 Database that lists all the products the user has selected to purchase. I have a command button that allows the user to increment the qty of the product by one. The code is just rs("Qty") = rs("qty") + 1

On a pc (win98) machine that is running IE 5.0 it works fine but If you run it on a PC (win98) machine that is running IE 5.5 the total it returns is 3. Any help would be appreciated

Ragenpryde

 
in discussing this with my coworker, he ran into the same thing in a different way. what appears to have happened (?) is that for/next loops (according to him) now auto increment(?) when they hit the next. so check your code and see if that incrementer is in a loop, if so it would increment twice. depending on how it's written may/maynot be the issue.
hth
mark
 
correct ;)

for next loops in asp from my expierience DO Auto increment.
 
Hi all,

In general, these kinds of problems are relatively easy to debug by being liberal with response.write-statements - simply print the values of your variables onto the screen before and after each problematic statement! I use this a lot, and find it extremely helpful - and once everything is running OK, just comment out or remove the write-statements.

Hope this can be of help!

DrMaggie
---------
"Those who don't know the mistakes of the past won't be able to enjoy it when they make them again in the future."
— Leonard McCoy, MD (in Diane Duane's Doctor's Orders)
 
this is whats baffling me, it seems to be a bug or version conflict in IE 5.5 and 6.0. My code works great on IE 5.0, and the code functions the way it should in 5.5, but it just runs every button click twice. Im posting one of my case statements for you all to look at. you get into this case statement by clicking on a button that opens this form and passes a Pagemode varialbe. but in IE 5.5 its as if it gets the page twice, the first time it runs through the code, and no order is present, it will create the order and add the item to the order table, and for what ever reason, (this is where the problem lies) it will run the code again, see that there is anorder for this session ID and add the item a second time in the orderid table. but again I must stress that this ONLY happens when using IE 5.5 or higher, if you run the page with IE 5.0 the code works great and only inserts the item once. any help would be appreciated. heres the code :

Case "order"
sql = "SELECT ProdId, ProdName, ProdNumber, CatId, ShortDesc, LongDesc, Price, Terminate, PictureFileName, PDFFile, ModDate FROM tblProd "
sql = sql & "WHERE prodid = "& varprodid & " AND Terminate = false"
rs.Open sql, conn, adOpenStatic, adLockReadOnly, adCmdText
varprice = rs("Price")
rs.Close

sql = "SELECT orderid, ordate, orderNum,userID,status,ModDate,terminate, orSessionid FROM tblOrder "
sql = sql & " WHERE orSessionId = '" & varSessionId & "'"
rs.Open sql, conn, adOpenStatic, adLockReadOnly, adCmdText

IF NOT(rs.EOF or rs.BOF)Then
sOrderNumber = rs("ordernum")
sql2 = "SELECT Prodid, price,orderid,qty FROM tblOrderID WHERE Prodid = '" & varProdId & "'"
rs2.Open sql2, conn, adOpenStatic, adLockPessimistic
rs2.Close

sOrderid = rs("orderid")
tblName = "tblOrderID"
rs2.Open tblName, conn, adOpenKeyset, adLockPessimistic, adCmdTable

rs2.AddNew
rs2.Fields("ProdID") = varprodid
rs2.Fields("orderID") = sOrderid
rs2.Fields("price") = varPrice
rs2.Fields("qty") = 1
rs2.Update
rs2.Close
rs.Close

else
rs.Close
sql = "SELECT orderid, ordate, orderNum,userID,status,ModDate,terminate, orSessionid FROM tblOrder"


tblName = "tblOrder"
rs.Open tblName, conn, adOpenKeyset, adLockPessimistic, adCmdTable

rs.AddNew
rs.Fields("orSessionid") = varsessionid
rs.Fields("ordernum") = sOrderNumber
rs.Fields("orDate") = date()
rs.Fields("status") = "UNORDERED"
rs.Update

sorderid = rs("orderid")

tblName = "tblOrderID"
rs2.Open tblName, conn, adOpenKeyset, adLockPessimistic, adCmdTable
rs2.AddNew
rs2.Fields("ProdID") = varprodid
rs2.Fields("orderID") = rs("orderid")
rs2.Fields("price") = varPrice
rs2.Fields("qty") = 1
rs2.Update
rs2.Close
rs.Close
end if
 
the answer has arrived! IT appears that in IE 5.5 they have changed the order of operations. I changed the button type from submit to "button". once I did that it all fell into place. thank you so much to everyone that helped me on this project.


Ragenpryde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top