Inner Join question

R

Robin

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!!
 
B

Bob Barrows [MVP]

Robin said:
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
 
R

Roland Hall

in message
: 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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top