Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2003
    Location
    Illinois
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Very strange problem, please help.

    On an ASP page, the code below is throwing an error on the line "getAWvr = False". We originally assign this variable a value of True.
    ======================================================
    strSQL = "Select Fein From Emp_Hist Where Emp_Hist.SSN=" & da_ssn
    strSQL = strSQL + " And Emp_Hist.Fein<>" & varFein
    strSQL = strSQL + " And emp_hist.branch<>" & cInt(m_branch)
    strSQL = strSQL + " And entry_date<>'" & Date & "'"

    Set oRS = OConn.Execute(strSQL)
    If Not oRS.EOF Then
    GetAWvr = Flase
    End If
    oRS.Close
    ======================================================
    I can't see anything wrong with it. I have tried changing the variable name, making it assign character and numberic data, but it keeps generating an error. If I take out the line, comment it out or change the If statement so it won't execute, no error is generated. What is going on? It looks like a perfectly good assignment statement to me.

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Posts
    120
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Typo...
    It doens't say that on that line, it says GetAWvr = Flase.

    HTH, Tom

  • #3
    New Coder
    Join Date
    Jan 2003
    Location
    Illinois
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply. That was a typo on my part. When I copied it in, I was trying to assign it as character ("N"), but I thought it would be easier to understand as logical so I changed it. Believe me, even when it says False it doesn't work.

    I have also changed all references to GetAWvr to be character (GetAWvr = "N") and numeric (GetAWvr = 1). No matter what I assign to that variable at that place, it generates an error.

    When I initialize it, it is fine, regardless of whether I set it to True, "N" or 0. But when I reassign it inside the If statement, it generates an error. Commenting out the line stops the error.

    As a work around, if it is not EOF then I set up a loop and skip through the records I can accomplish what I need to do. But I can't understand why a simple assignment would generate an error here. I guess I could also look at the record count returned and it might work.

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    whats the error your getting?

  • #5
    New Coder
    Join Date
    Jan 2003
    Location
    Illinois
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    All it says is "Syntax Error, Line 362". I can't get a good error message, the syntax looks good to me.

    I have deleted the line and retyped it, just in case there was a hidden character in it. It didn't help.

    I did reverse the logic, and moved the statement to an "Else" clause, it generated an error when it executed. Still, the assignment statement looks good. I checked the code, and the GetAWvr variable is only in 3 places, the original assignment, the reassignment where the error is generated, and an additional "If" statement later in the code to perform an action if it has been set.

    I beginning to think any assignment statement I put in the If statement will generate an error. I can't see anything wrong with the assignment statement. It seems like every once-in-a-while, ASP just finds a line of code it doesn't like.

    I am at another site today, so I can't work with it. Tomorrow I will try other assignment statements and move the offending statement to other places in the code to see how it works.

  • #6
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    hmm, I see.

    well I've found that sometime if other code in the page is missing or has incorrect syntax, that the ASP engine will report the error as being on another different line,

    try this, and see if it helps:
    PHP Code:
    strSQL "Select Fein From Emp_Hist Where SSN = '" da_ssn "' And Fein = '" varFein "' And branch = '" cInt(m_branch) & "' And entry_date = '" Date "'"
    Set oRS OConn.Execute(strSQL)
    If 
    Not oRS.EOF Then
        GetAWvr 
    false
    End 
    If
    oRS.Close 


  •  

    Posting Permissions

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