Results 1 to 3 of 3

Thread: Tornado-SQL Update and IF Statement

  1. #1
    Join Date
    Dec 2002
    Location
    Albany, NY
    Posts
    115

    Tornado-SQL Update and IF Statement

    Maybe someone can explain the behavior of the SQL Update command used within an IF\THEN\ELSE clause.

    Here's the situation, I'm using the evn=javafunction() within the .dbQP function. The java script returns a 0 or 1 depending upon which radio button the user selects. I have the SQL UPDATE commands nested within the IF\THEN\ELSE clause. The problem is, the system does not evaluate the IF condition, it loads the first UPDATE statement regardless of the condition.

  2. #2
    Join Date
    Oct 2002
    Posts
    933
    1. State what you want to do. There might be an easier way.

    2. Post your simplified NWIND code with your idea.

    Sounds like you want to click a button (user button?) to control what SQL to execute (on re-entry)? Or you want to inlclude a user radio in the update screen and upon Update, decide what SQL to use?


    Frank

  3. #3
    Join Date
    Oct 2002
    Posts
    933
    Try this one ->

    Dim Qt = Request.Form("Qtype")
    Dim Mydb As New tornado.z
    With Mydb
    .dbQP = "Unit=12| Mode=Grid| Skin=plain| DSN=Nwind| SQL=SELECT * From Orders| gdf=0,1,2,3| BM=Orders;0"
    .dbSQL = "SELECT * From Orders"
    If Qt = "SQL 1" Then
    .dbEditUpdateSQL = ".............."
    Else
    .dbSQL = "........................."
    End If
    .dbNavigationItem = "b5,update"
    Dim e1 As String = "<input type='radio' value='SQL 1' checked name='QType'>SQL1<input type='radio' name='QType' value='SQL 2'>SQL 2"
    .dbTextHolder = "Title=User Control| Edit1=" & e1
    .ASPdbNET()
    End With

Posting Permissions

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