Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

ASP Woes

Name: TJD 2007-05-13 18:01 ID:LbHyk12n

Unfortunately I have to write an application for a client in ASP. For some reason they think that ASP/SQL Server is the way to go. Anyway, I'm trying to do a simple select population and tag on "selected" to whichever one the current ID matches up with. Here's my code:

                While Not jobs.EOF
                    If jobs.Fields.Item("title") <> "" Then
                        Response.Write "<option value=""" & jobs.Fields.Item("id").Value & """"
                        If  jobs.Fields.Item("id").Value = id Then
                            Response.Write " selected"
                        End If
                        Response.Write ">" & jobs.Fields.Item("title").Value & "</option>"                       
                    End If
                   
                    jobs.MoveNext()
                Wend

However, it doesn't output selected for any of them (I've made sure numerous times that they are actually equal, and every single time it's correct). What's the deal here?

Name: Anonymous 2007-05-13 18:07 ID:Heaven

Quit the job or backdoor them

Name: TJD 2007-05-13 18:07 ID:LbHyk12n

Goddamnit, nevermind. I enclosed the DB id in a cstr and that fixed it. I hate ASP so much.

Name: Anonymous 2007-05-13 18:23 ID:1nUBHBnJ

>>3

You should hate your own incompetence.

Name: TJD 2007-05-13 18:28 ID:LbHyk12n

No, I'll just continue to hate ASP's inconsistencies.

Name: Anonymous 2007-05-13 18:37 ID:1nUBHBnJ

>>5

You don't even understand that the thing you're annoyed at isn't ASP, it's VBScript. And you're only annoyed at it because you're too incompetent at using it to understand how it handles data types.

Name: Anonymous 2007-05-13 18:39 ID:47iH4RPt

>>5
For all the crappy things MS has written, ASP is at least an order of magnitude *more* consistent than PHP.

Not that it isn't still sucky.

Name: TJD 2007-05-13 22:16 ID:LbHyk12n

>>6

Because I expect that when I give it an integer, it'll see it as an integer? Yeah, that's incompetence for sure.

Name: TJD 2007-05-13 22:22 ID:LbHyk12n

>>6

Oh, and VBScript run with c/wscript would actually throw an error. ASP on this server does nothing of the sort. So really, it is ASP's fault.

Name: Anonymous 2007-05-14 7:02 ID:KTWcbW//

Stop doing ASP

Name: Anonymous 2007-05-14 11:26 ID:5repF1r1

>>9

See http://msdn2.microsoft.com/en-us/library/9hck4s70.aspx for semantics.

Also, no error here in the scripting host here. Just how it is supposed to behave:


X:\> copy con test.vbs

A = "9000"
B = 9000

WScript.Echo "Straight Comparison:"
If A=B Then
  WScript.Echo "They are equal"
Else
  WScript.Echo "They are not equal"
End If

WScript.Echo "A cast to integer:"
If CInt(A)=B Then
  WScript.Echo "They are equal"
Else
  WScript.Echo "They are not equal"
End If

WScript.Echo "B cast to string:"
If A=CStr(B) Then
  WScript.Echo "They are equal"
Else
  WScript.Echo "They are not equal"
End If

^Z
        1 file(s) copied.

X:\> cscript test.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Straight Comparison:
They are not equal
A cast to integer:
They are equal
B cast to string:
They are equal

X:\>

Name: Anonymous 2009-01-14 14:59

Trolls

Name: Anonymous 2011-02-04 16:14

Name: Sgt.Kabu驺♮kiman遨⛣ 2012-05-29 1:41

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List