looping problem

Discussion in 'ASP General' started by shank, Feb 21, 2004.

  1. shank

    shank Guest

    I am getting the following error on the below code.

    Expected end of statement
    Next i
    -----^

    How do I fix that?
    thanks!

    <%
    Dim DataConn2
    Dim i
    Set DataConn2 = Server.CreateObject("ADODB.Connection")
    DataConn2.Open MM_kasKSS_STRING
    For i = 0 To rsOrderDetails.ListCount -1 Step 1
    SQL = "INSERT INTO wsOrderDetails (OrderID, OrderNo, Description, Qty,
    PriceEach, Priceline) "
    SQL = SQL & "Values ('" & iod_OrderID & "', '" & iod_OrderNo & "', '" &
    iod_Description & "', " & iod_Qty & ", " & iod_PriceEach & ", " &
    iod_Priceline & ")"
    Next i
    DataConn2.Execute(SQL)
    %>
    shank, Feb 21, 2004
    #1
    1. Advertising

  2. shank

    Chris Barber Guest

    See post in the first thread - I presume this was a mistake post and was
    meant to be part of the main thread.

    Chris.

    "shank" <> wrote in message
    news:ehwYycM%...
    I am getting the following error on the below code.

    Expected end of statement
    Next i
    -----^

    How do I fix that?
    thanks!

    <%
    Dim DataConn2
    Dim i
    Set DataConn2 = Server.CreateObject("ADODB.Connection")
    DataConn2.Open MM_kasKSS_STRING
    For i = 0 To rsOrderDetails.ListCount -1 Step 1
    SQL = "INSERT INTO wsOrderDetails (OrderID, OrderNo, Description, Qty,
    PriceEach, Priceline) "
    SQL = SQL & "Values ('" & iod_OrderID & "', '" & iod_OrderNo & "', '" &
    iod_Description & "', " & iod_Qty & ", " & iod_PriceEach & ", " &
    iod_Priceline & ")"
    Next i
    DataConn2.Execute(SQL)
    %>
    Chris Barber, Feb 21, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mothra
    Replies:
    3
    Views:
    420
  2. CJ
    Replies:
    0
    Views:
    1,812
  3. Stephan Bour
    Replies:
    1
    Views:
    473
    Hermit Dave
    Dec 12, 2003
  4. VB Programmer
    Replies:
    3
    Views:
    5,260
    Marina
    Jul 27, 2004
  5. Replies:
    5
    Views:
    256
Loading...

Share This Page