ASP Connecting to MySQL

Results 1 to 2 of 2

Thread: ASP Connecting to MySQL

  1. #1
    Join Date
    Dec 1969

    Default ASP Connecting to MySQL

    I know that MySQL isn&#039;t listed in the databases for this forum but I am hoping that my error is something more general than db-specific. <BR>I am trying to do a search through certain fields in different tables for certain keywords. I have created a list from 2 of the tables and wish to use them in an IN clause. This is the SQL statement I have generated.<BR><BR>SELECT * FROM team WHERE 1=1 OR team.teambio LIKE &#039;%a%&#039; OR WHERE team.eventid IN (2,3,4) GROUP By team.eventID ORDER BY team.teamname<BR><BR>The open statement throws an error of ODBC driver does not support requested properties.<BR><BR>The list in the IN clause does not work if it looks like this (&#039;2,3,4&#039;) or like this (&#039;2&#039;,&#039;3&#039;,&#039;4&#039;) either. The GROUP BY and ORDER BY clauses are optional for my purposes but I believed that I had to include them in order for the IN statement to work.<BR><BR><BR>Thank you in advance for any help you can give me

  2. #2
    Join Date
    Dec 1969

    Default You can't repeat WHERE

    This is true of any dialect of SQL, not just MySQL&#039;s.<BR><BR>You repeated the keyword WHERE. Not allowed.<BR><BR>However... That query *WILL* return EVERY SINGLE RECORD. So why bother with the WHERE clause??<BR><BR>After all, 1=1 is TRUE for each and every single record, isn&#039;t it?<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