Wrox Programmer Forums
|
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 12th, 2005, 05:40 PM
Authorized User
 
Join Date: Aug 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Transform query

Hello everyone,

Do you know if ASP supports Transform query?

Here is the my code:

strMonth = "TRANSFORM Count([PrimaryKey]) AS CountOfPrimaryKey SELECT (Format([Received Date],'MMM')) AS sMonth FROM [2005 Received Records] WHERE SUPPLIER = '" &Supp& "' GROUP BY (Year([Received Date])*12+Month([Received Date])-1), (Format([Received Date],'MMM')) PIVOT [SubLate]"

When I first run the same query, successfully return the expected data. After that the recordset eventually has began to come back empty all the time.

Any help would be appreciated...

Thanks,


 
Old September 13th, 2005, 05:11 PM
Authorized User
 
Join Date: Mar 2005
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to arimakidd
Default

Some how I think your leaving out some of the code. Are you querying an Access or MYSQL Datastore? Usually when I get this kind of problem where the query works fine the first time and then returns an error or comes up empty its because instead of de-referencing my recordsets I just use the Resposne.End. So instead of:

Code:
vaObj.Close
Set vaObj = Nothing
I just use
Code:
Response.End
Give it a try, I don't have the technical explanation as to why this works with me now but will post it later.

 
Old October 4th, 2005, 08:50 AM
Authorized User
 
Join Date: Aug 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I am querying Access datastore. I used Response.End instead of
rsMonth.Close()
set rsMonth=Nothing

but it didn't work. This problem is making me crazy. I don't get any error, I just get empty recordset all the time. The query works fine in Access environment.

This is my code:

strMonth = "TRANSFORM Count([2005 Received Records].PrimaryKey) AS CountOfPrimaryKey SELECT (Format([Received Date],'mmm')) AS [Month] FROM [2005 Received Records] GROUP BY (Year([Received Date])*12+Month([Received Date])-1), (Format([Received Date],'mmm')) PIVOT [2005 Received Records].SubLate"
set rsMonth= Server.CreateObject("ADODB.Recordset")
rsMonth.Open strMonth, objConn

    <tr>
        <td class="TitleName"><b>Month</b></td>
        <td class="TitleName"><b>Late#</b></td>
        <td class="TitleName"><b>Total#</b></td>
    </tr>


<%Do While Not rsMonth.EOF%>
    <tr>
        <td><center><b><%=rsMonth("Month")%></b></center></td>
        <td><center><b>><%=rsMonth("Late")%></b></center></td>
        <td><center><b>><%=rsMonth("On Time")%>
    </tr>
        <%rsMonth.MoveNext
        Loop%>

rsMonth.Close()
set rsMonth=Nothing


Thank you for your help...






Similar Threads
Thread Thread Starter Forum Replies Last Post
transform date vsempoux XSLT 2 July 9th, 2008 09:48 AM
wml transform arunagottimukkala XSLT 13 November 8th, 2007 09:12 AM
Transform Automatically DJAJ XSLT 0 March 10th, 2006 09:38 PM
transform in xslt kgoldvas XSLT 1 January 24th, 2006 07:14 AM
XSLT Transform scubaduba C# 0 November 30th, 2004 06:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.