Inner Join question

Discussion in 'ASP General' started by Robin, Apr 20, 2004.

  1. Robin

    Robin Guest

    I've never done an INNER JOIN before, so I'm just trying to figure it out.
    The following is giving me this error:

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [MySQL][ODBC 3.51 Driver][mysqld-4.0.15-max-debug]Unknown table 'owners' in
    field list
    /db/cust2.asp, line 16

    And this is line 16:

    set rsTMP = conn.execute("Select sites.siteID, sites.ownerID,
    owners.OwnerID, owners.OwnerName from Owners INNER JOIN sites on
    owners.OwnerID = sites.OwnerID")


    there is a table called Owners so it does exists and I'm guessing it's just
    something wrong with my syntax.
    thanks!!
     
    Robin, Apr 20, 2004
    #1
    1. Advertisements

  2. Robin wrote:
    > I've never done an INNER JOIN before, so I'm just trying to figure it


    I know little about MySQL, but I do know that the best way to create and
    test queries in any database is to create and test them using the native
    query execution tool for the database server you are using. Get them working
    there before attempting to run them from asp.At the very least, you will
    probably get a better error message than the one you are getting from ODBC.
    The query tool may even point you at the error.

    > out. The following is giving me this error:
    >
    > Error Type:
    > Microsoft OLE DB Provider for ODBC Drivers (0x80004005)


    Do you need to use ODBC? I thought there was a native MySQL OLEDB provider
    .... if so, you should use it. See www.able-consulting.com/ado_conn.htm for
    connection string examples.

    > [MySQL][ODBC 3.51 Driver][mysqld-4.0.15-max-debug]Unknown table
    > 'owners' in field list
    > /db/cust2.asp, line 16
    >
    > And this is line 16:
    >
    > set rsTMP = conn.execute("Select sites.siteID, sites.ownerID,
    > owners.OwnerID, owners.OwnerName from Owners INNER JOIN sites on
    > owners.OwnerID = sites.OwnerID")
    >
    >
    > there is a table called Owners so it does exists and I'm guessing
    > it's just something wrong with my syntax.
    > thanks!!


    This query would run as-is in Access or MS SQL Server. I don't know if your
    syntax is invalid for MySQL. Doesn't MySQL provide some product support?
    Have you looked for a MySQL newsgroup? You probably won't find one on the MS
    public news server, but Google should help you find one if it exists.

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Apr 20, 2004
    #2
    1. Advertisements

  3. Robin

    Roland Hall Guest

    "Robin" wrote in message
    news:LIfhc.64706$...
    : I've never done an INNER JOIN before, so I'm just trying to figure it out.
    : The following is giving me this error:
    :
    : Error Type:
    : Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    : [MySQL][ODBC 3.51 Driver][mysqld-4.0.15-max-debug]Unknown table 'owners'
    in
    : field list
    : /db/cust2.asp, line 16
    :
    : And this is line 16:
    :
    : set rsTMP = conn.execute("Select sites.siteID, sites.ownerID,
    : owners.OwnerID, owners.OwnerName from Owners INNER JOIN sites on
    : owners.OwnerID = sites.OwnerID")
    :
    :
    : there is a table called Owners so it does exists and I'm guessing it's
    just
    : something wrong with my syntax.
    : thanks!!

    Your syntax looks correct. You should be aware that tables are stored as
    files. *nix is case-sensitive. If the table is actually Owner, then owner
    does not exist.

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
     
    Roland Hall, Apr 20, 2004
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gareth Stretch
    Replies:
    0
    Views:
    5,371
    Gareth Stretch
    Jun 26, 2003
  2. Gene Ariani
    Replies:
    0
    Views:
    2,892
    Gene Ariani
    Aug 21, 2003
  3. Carlo v. Dango
    Replies:
    14
    Views:
    1,401
    Alex Martelli
    Oct 19, 2003
  4. Tim Chase
    Replies:
    6
    Views:
    367
    Michael J. Fromberger
    Feb 28, 2006
  5. Pyenos
    Replies:
    2
    Views:
    635
    Pyenos
    Dec 27, 2006
  6. the chad

    I cannot get this inner join to work in asp

    the chad, Aug 8, 2003, in forum: ASP General
    Replies:
    3
    Views:
    169
    The Chad
    Aug 11, 2003
  7. Jeff Uchtman

    HELP! Left, Right, Inner Join

    Jeff Uchtman, Apr 7, 2004, in forum: ASP General
    Replies:
    0
    Views:
    221
    Jeff Uchtman
    Apr 7, 2004
  8. Jeff

    Complicated inner join??

    Jeff, Dec 20, 2005, in forum: ASP General
    Replies:
    26
    Views:
    493
    Bob Barrows [MVP]
    Dec 22, 2005
Loading...