Re: Complex Select Problem?

Dee Holtsclaw <[email protected]> Tue, 27 Aug 2002 10:18:21 -0400
Newsgroups gmane.comp.windows.devel.oledb.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.

------=_NextPart_000_0004_01C24DB3.11E99280
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

You're doing it backwards -- try it this way:

"Select a.StatusCode As DaStatus, c.Description As DaType, a.Year As DaYear,
b.Description as DaMake, a.Model As DaModel, a.Retails As DaPrice FROM
Inventory AS a, Makes AS b, Types AS c WHERE a.Make=b.Make And
a.Type=c.Type"

Dee
(Lawrence D. Holtsclaw)

 -----Original Message-----
From: OLEDB_DEV [mailto:[email protected]]On Behalf Of Dustin
Wish with NCA Communications
Sent: Monday, August 26, 2002 11:59 PM
To: [email protected]
Subject: [OLEDB_DEV] Complex Select Problem?



  I am having a problem with

  "SELECT DaStatus AS a.StatusCode, DaType = c.Description, DaYear =
a.[Year], DaMake = b.Description,DaModel = a.Model, DaPrice = a.Retails FROM
Inventory AS a, Makes AS b, Types AS c WHERE a.Make=b.Make And
a.Type=c.Type"

  I had a heck of a time figuring out that you can't do paging with a
datareader you must use a dataset, but now this?

  Tried using AS instead of = ut no luck? I keep getting:


  Server Error in '/' Application.
----------------------------------------------------------------------------
--

  The SELECT statement includes a reserved word or an argument name that is
misspelled or missing, or the punctuation is incorrect.
  Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

  Exception Details: System.Data.OleDb.OleDbException: The SELECT statement
includes a reserved word or an argument name that is misspelled or missing,
or the punctuation is incorrect.


  Any Help?




  Dustin Wish
  Data and Networking Technician
  NCA Communications, Inc.


  "Facts do not cease to exist because they are ignored." - Aldous Huxley
  "Don't let your minds be cluttered up with the prevailing doctrine." -
Alexander Fleming (1881-1955)

  ***


  You can read messages from the OLEDB_DEV archive, unsubscribe from
OLEDB_DEV, or subscribe to other DevelopMentor lists at
http://discuss.develop.com.

You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

------=_NextPart_000_0004_01C24DB3.11E99280
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3502.4373" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D037161014-27082002>You're=20
doing it backwards -- try it this way:</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D037161014-27082002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D037161014-27082002>"Select a.StatusCode As DaStatus, =
c.Description As=20
DaType, a.Year As DaYear, b.Description as DaMake,&nbsp;a.Model As=20
DaModel,&nbsp;a.Retails As DaPrice FROM Inventory AS a, Makes AS b, =
Types AS c=20
WHERE a.Make=3Db.Make And a.Type=3Dc.Type"</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D037161014-27082002></SPAN></FONT>&nbsp;</DIV>
<DIV><SPAN class=3D037161014-27082002>
<P><FONT color=3D#0000ff face=3DArial size=3D2>Dee<BR>(Lawrence D.=20
Holtsclaw)</FONT></SPAN><FONT face=3DTahoma><FONT size=3D2><SPAN=20
class=3D037161014-27082002><FONT color=3D#0000ff=20
face=3DArial>&nbsp;</FONT></SPAN></FONT></FONT></P>
<P><FONT face=3DTahoma><FONT size=3D2><SPAN=20
class=3D037161014-27082002>&nbsp;</SPAN>-----Original =
Message-----<BR><B>From:</B>=20
OLEDB_DEV [mailto:[email protected]]<B>On Behalf Of =
</B>Dustin Wish=20
with NCA Communications<BR><B>Sent:</B> Monday, August 26, 2002 11:59=20
PM<BR><B>To:</B> [email protected]<BR><B>Subject:</B> =
[OLEDB_DEV]=20
Complex Select Problem?<BR><BR></P></FONT></DIV>
<BLOCKQUOTE></FONT>
  <DIV><FONT face=3DArial size=3D2>I am having a problem =
with</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>"SELECT DaStatus AS a.StatusCode, =
DaType =3D=20
  c.Description, DaYear =3D a.[Year], DaMake =3D b.Description,DaModel =
=3D a.Model,=20
  DaPrice =3D a.Retails FROM Inventory AS a, Makes AS b, Types AS c =
WHERE=20
  a.Make=3Db.Make And a.Type=3Dc.Type"</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>I had a heck of a time figuring out =
that you=20
  can't do paging with a datareader you must use a dataset, but now=20
  this?</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Tried using AS instead of =3D ut no =
luck? I keep=20
  getting:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><SPAN>&nbsp;</DIV>
  <H1>Server Error in '/' Application.=20
  <HR color=3Dsilver SIZE=3D1 width=3D"100%">
  </H1>
  <H2><I>The SELECT statement includes a reserved word or an argument =
name that=20
  is misspelled or missing, or the punctuation is incorrect.</I> </H2>
  <DIV></SPAN><FONT=20
  face=3D"Arial, Helvetica, Geneva, SunSans-Regular, sans-serif =
"><B>Description:=20
  </B>An unhandled exception occurred during the execution of the =
current web=20
  request. Please review the stack trace for more information about the =
error=20
  and where it originated in the code. <BR><BR><B>Exception Details:=20
  </B>System.Data.OleDb.OleDbException: The SELECT statement includes a =
reserved=20
  word or an argument name that is misspelled or missing, or the =
punctuation is=20
  incorrect.<BR></FONT></DIV>
  <DIV><FONT=20
  face=3D"Arial, Helvetica, Geneva, SunSans-Regular, sans-serif =
"></FONT>&nbsp;</DIV>
  <DIV><FONT face=3D"Arial, Helvetica, Geneva, SunSans-Regular, =
sans-serif "><FONT=20
  size=3D2>Any Help?</FONT></DIV></FONT>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Dustin Wish<BR>Data and Networking=20
  Technician<BR>NCA Communications, Inc.</FONT></DIV>
  <DIV>&nbsp;</DIV><FONT face=3DArial size=3D2>
  <DIV><BR>"Facts do not cease to exist because they are ignored." - =
Aldous=20
  Huxley<BR>"Don't let your minds be cluttered up with the prevailing =
doctrine."=20
  - Alexander Fleming (1881-1955) </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>*** </DIV>
  <DIV>&nbsp;</DIV>
  <DIV></FONT>&nbsp;</DIV>You can read messages from the OLEDB_DEV =
archive,=20
  unsubscribe from OLEDB_DEV, or subscribe to other DevelopMentor lists =
at=20
  http://discuss.develop.com. </BLOCKQUOTE></BODY></HTML>
You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

------=_NextPart_000_0004_01C24DB3.11E99280--