Type mismatch : string

Results 1 to 4 of 4

Thread: Type mismatch : string

  1. #1
    Alex Muro Guest

    Default Type mismatch : string

    when i try to put + Session("id") which is set to an number value to the end of a SQL statement I keep getting a Type mismatch: &#039[string: error. the code looks like this:<BR><BR> Set temp = Conn.Execute("SELECT * FROM users WHERE id="+ Session("user"))<BR><BR>This has been stumpen me for a while, thanx in advance for any help

  2. #2
    Join Date
    Dec 1969

    Default ASPFAQs -- category Database Queries

    The link to ASPFAQs is at the top right of this page.<BR><BR>

  3. #3
    Karl Guest

    Default RE: Type mismatch : string

    Adding an integet to a string literal? I don&#039t think so.<BR><BR><BR>what would you suggest that "heheh" + 3 should equal? An error seems about right.<BR><BR>you can add string&#039s to string&#039s, integers to integers, integers to floats, and who knows what else...but not integers to strings.<BR><BR>You have to append your # to your string --&#062;"SELECT * FROM users WHERE id = " and to do that, use an &, not a +<BR><BR>karl

  4. #4
    Join Date
    Dec 1969

    Default Good catch, Karl!

    I&#039m so used to seeing & used for concatenation that I missed the + !!<BR><BR>

Posting Permissions

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