Re: MS Access SQL > ASP SQL problem....

From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 01/05/05


Date: Wed, 5 Jan 2005 09:19:29 -0500

david@scene-double.co.uk wrote:
> Hi,
>
> I have the following code which returns an error

What error?

> when run as part of
> my ASP SQL....
>
> strquery = strquery & "FROM (Customers INNER JOIN Orders ON
> Customers.CustomerID = Orders.CustomerID) INNER JOIN (Products INNER
> JOIN (OrderLines INNER JOIN StockMovements ON OrderLines.JobNumber =
> StockMovements.JobNumber) ON (Products.ProductID =
> OrderLines.ProductID) AND (Products.ProductID = OrderLines.ProductID))
> ON Orders.OrderID = OrderLines.OrderID"
>
> I have copied this direct from MS Access Query SQL. How would I adapt
> this code to work in ASP ?
>
>
The only way to debug a sql statement is to know what it is. Do

Response.Write strquery

to see what your vbscript code has generated. If it is correct you should be
able to copy and paste it from the browser window into the SQL View of an
Access Query Builder and run it without modification (unless wildcards are
involved).

You would be better off executing the saved query directly instead of
dealing with all the dynamic sql nonsense:
http://groups-beta.google.com/group/microsoft.public.inetserver.asp.db/msg/7d6e8544e2fd6889?oe=UTF-8

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.


Relevant Pages

  • Re: DIVIDE BY ZERO ERROR, WHEN RUN FROM ASP PAGE
    ... then the issue is the parameter values being passed from ASP. ... I would suggest using SQL Profiler to verify that the parameter values ... being sent to SQL Server are the ones you expect them to be. ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Stripping Out Quotes For Database Storage
    ... Aaron [SQL Server MVP] wrote: ... > The only problem character when building dynamic SQL statements in ASP ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Access Query to SQL
    ... Please show us the Response.Write SQL version of this statement (which will ... > Microsoft OLE DB Provider for ODBC Drivers ... > If I remove the 'Having' clause the ASP works, ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Web page content in database + formatting?
    ... Sounds like an sql user function, i would be asking in sql programing or a ... But creating a filter for searching would not be that hard i would assume in ... you can you could create a stored procedure that called from the asp ... Anyway it does sound like an sql newsgroup question. ...
    (microsoft.public.inetserver.asp.general)
  • Re: ASP, looping, and stored procedures.... error 800a0bb9 ...
    ... > page PER loop. ... The looping goes by month from and to dates selected ... > In pure ASP the page takes about 15 seconds. ... > Oh, and by the way, the test box has SQL server and IIS on it. ...
    (microsoft.public.inetserver.asp.db)