SQL Query returns wrong record

Results 1 to 3 of 3

Thread: SQL Query returns wrong record

  1. #1
    Neils Guest

    Default SQL Query returns wrong record

    I have a database of printers and their attributes. There are duplicate printer names in the DB, where the name is the same but the capitalization is different and the attributes of the two listings are different.<BR><BR>I have a page that add&#039s a printer to the DB. However, if there is already a printer in the DB with that name (but different capitalization) the confirmation page returns that one.<BR><BR>I use this statement to insert the new printer into the DB:<BR>"INSERT INTO PRINTERTYPES (PRINTERNAME) VALUES (&#039" & printer & "&#039)"<BR><BR>And I use this statement to query the database for the new printer and get it&#039s ID number so I can display the printer in the confirmation page:<BR>"SELECT printername, id FROM printertypes WHERE printername = &#039" & printer & "&#039"<BR><BR>These two statements are on the same page and the variable "printer" doesn&#039t change values. <BR><BR>Does anyone know why the SELECT statement returns the wrong record???

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL Query returns wrong record

    the sql is not case sensitive - why not use the printers IP adresses or something like that instead - I dont know how you can force sql to be case sensitive probably depends on the database<BR>good luck!

  3. #3
    Neils Guest

    Default RE: SQL Query returns wrong record

    IP number isn&#039t part of the database because each printer can have multiple instances on our network. We&#039re in a (very large) Terminal Server environment so the DB is used to keep track of what servers the printer drivers are installed on, which sites have what printer and so forth.<BR><BR>Any other suggestions?

Posting Permissions

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