VB error

Results 1 to 2 of 2

Thread: VB error

  1. #1
    monir Guest

    Default VB error

    can you tell me what&#039s wrong with this:<BR>&#060;% <BR><BR>FOR i = 0 TO UBOUND( localCart, 2 )<BR>IF localCart(CARTPID, i) &#060;&#062; "" THEN<BR>localCart = (localCart( CARTPPRICE, i ) * localCart( CARTPQUANTITY, i ))<BR>orderTotal = orderTotal + localCart<BR><BR>%&#062;<BR><BR>it is giving me this error:<BR>Microsoft VBScript runtime error &#039 800a000d&#039 <BR>Type mismatch: &#039[string: ""]&#039 <BR><BR>/Aspfiles/sessionCart.asp, line 85 <BR><BR><BR>thanks <BR>also if Bart is reading this, I gave up with that con connection I think it has to do with using Access. I spent the whole night on it couldn&#039t fix it

  2. #2
    Join Date
    Dec 1969

    Default RE: VB error

    The following line doesn&#039t make sense as you&#039re trying to assign a number to an array without specifying the element you want to update:<BR><BR>localCart = (localCart( CARTPPRICE, i ) * localCart( CARTPQUANTITY, i ))<BR><BR>I guess that CARTPRICE and CARTPQUANTITY are constants referring to the position in the first dimension of the array where you store the respective values, and that localCart IS that array.<BR><BR>Think something like the following would make more sense (or at least use a different variable to store the result):<BR><BR>localCart( CARTPTOTAL, i) = (localCart( CARTPPRICE, i ) * localCart( CARTPQUANTITY, i ))<BR><BR>Where CARTPTOTAL is the position at which you want to store the total price for the order line.<BR><BR>Not sure that addresses your actual error, though (might help to know which line is number 85). Have you tried using ScriptDebugger to check the values of your variables as it runs?<BR><BR>Jerome.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts