-
Only getting first record in grid
Hi,
I have a page that displays a grid and when the index is clicked through to the form page, there will be a second grid which relies on an Export field from grid 1. For some reason, grid 2 will only show the first record from the recordset and show a 1 - 1: 1 in the Status Bar while I'm certain there are more than one record. I've response.write the SQL and pasted it into a query in Access and it always returns all of the records. Why would this happen?
Thanks,
Larry
<%
ASQL = "SELECT tblContacts.ContactID, tblContacts.LastName, tblContacts.FirstName, Count(tblPubs.PubID) AS PubCount " & _
"FROM (tblAuthors INNER JOIN tblContacts ON tblAuthors.ContactID = tblContacts.ContactID) INNER JOIN tblPubs ON tblAuthors.PubID = tblPubs.PubID " & _
"GROUP BY tblContacts.ContactID, tblContacts.LastName, tblContacts.FirstName"
Set A = Server.CreateObject("ASP.db"
A.dbUnit = 1007
A.dbDSN = "Epubs"
A.dbMode = "Both"
A.dbSQL = ASQL
A.dbGridTableTag = "Border=0"
A.dbGridIndex = False
A.dbGridCol = "3"
A.dbGridInc = "6"
A.dbFormDisplayFlds = "2,3"
A.dbNavigation = "None"
A.dbOptions = "HeaderFontTag=Face=Verdana Size=2, CellFontTag=Face=Verdana Size=2"
A.dbNavigation = "Top"
A.dbNavigationItem="grid, form, top, prev, next, bottom, row+, row-, grid+, grid-, form+, form-, filter, resetfilter, download, color, reload"
A.dbNavigationIcon="std"
A.dbExportFlds = "ContactID"
A.dbImageDir="images/"
A.dbNameMap = "FirstName,Author;PubCount, Pub Count"
A.dbMagicCell = "FirstName,,#FirstName# #LastName#, index;PubCount,align=center"
A.dbGridDisplayFlds = "FirstName, PubCount"
A.dbSuppressMsg = True
A.ASPdb
If A.dbLastScreen = "form" Then
response.write Session( "ASPDB_1007_ContactID" )
DSQL = "SELECT tblPubs.PubID, tblPubs.Title, tblPubs.PType, tblTargets.Target, tblPubs.Status " & _
"FROM (tblContacts INNER JOIN (tblPubs INNER JOIN tblAuthors ON tblPubs.PubID = tblAuthors.PubID) " & _
"ON tblContacts.ContactID = tblAuthors.ContactID) INNER JOIN tblTargets ON tblPubs.TargetID = tblTargets.targetID " & _
"WHERE (((tblContacts.ContactID)=" & Session( "ASPDB_1007_ContactID" ) & ")"
Set D = Server.CreateObject("ASP.db"
D.dbUnit = 1008
D.dbDSN = "Epubs"
D.dbMode = "Grid"
D.dbSQL = DSQL
D.dbGridTableTag = "Border=1"
D.dbGridIndex = False
D.dbGridInc = "6"
D.dbGridDisplayFlds = "0,1,2,3,4"
D.dbOptions = "HeaderFontTag=Face=Verdana Size=2, CellFontTag=Face=Verdana Size=2"
D.dbNavigation = "Bottom"
D.dbNavigationItem="grid, top, prev, next, bottom, row+, row-, grid+, grid-, form+, form-, filter, resetfilter, download, color, reload"
D.dbNavigationIcon="std"
D.dbExportFlds = "PubID"
D.dbImageDir="images/"
D.dbNameMap = "PType, Pub Type"
'D.dbMagicCell = "2,,<A HREF=pubs.asp?PUB=#(1)#>#(2)#</A>"
D.dbSuppressMsg = True
D.dbstatusBar = False
D.ASPdb
response.write DSQL
End If
%>
-
Only getting first record in grid (reply)
Larry,
You must add a D.dbReset(1008) after the
If D.dbUnit = 1008
because your Where clause has a variable in it.
Also, for testing, I suggest you set SuppressMsg=False and StatusBar=True.
Try that and see if it helps. Let me know, thanks,
Mark.
------------
Larry G at 2/20/01 12:58:37 PM
Hi,
I have a page that displays a grid and when the index is clicked through to the form page, there will be a second grid which relies on an Export field from grid 1. For some reason, grid 2 will only show the first record from the recordset and show a 1 - 1: 1 in the Status Bar while I'm certain there are more than one record. I've response.write the SQL and pasted it into a query in Access and it always returns all of the records. Why would this happen?
Thanks,
Larry
<%
ASQL = "SELECT tblContacts.ContactID, tblContacts.LastName, tblContacts.FirstName, Count(tblPubs.PubID) AS PubCount " & _
"FROM (tblAuthors INNER JOIN tblContacts ON tblAuthors.ContactID = tblContacts.ContactID) INNER JOIN tblPubs ON tblAuthors.PubID = tblPubs.PubID " & _
"GROUP BY tblContacts.ContactID, tblContacts.LastName, tblContacts.FirstName"
Set A = Server.CreateObject("ASP.db"
A.dbUnit = 1007
A.dbDSN = "Epubs"
A.dbMode = "Both"
A.dbSQL = ASQL
A.dbGridTableTag = "Border=0"
A.dbGridIndex = False
A.dbGridCol = "3"
A.dbGridInc = "6"
A.dbFormDisplayFlds = "2,3"
A.dbNavigation = "None"
A.dbOptions = "HeaderFontTag=Face=Verdana Size=2, CellFontTag=Face=Verdana Size=2"
A.dbNavigation = "Top"
A.dbNavigationItem="grid, form, top, prev, next, bottom, row+, row-, grid+, grid-, form+, form-, filter, resetfilter, download, color, reload"
A.dbNavigationIcon="std"
A.dbExportFlds = "ContactID"
A.dbImageDir="images/"
A.dbNameMap = "FirstName,Author;PubCount, Pub Count"
A.dbMagicCell = "FirstName,,#FirstName# #LastName#, index;PubCount,align=center"
A.dbGridDisplayFlds = "FirstName, PubCount"
A.dbSuppressMsg = True
A.ASPdb
If A.dbLastScreen = "form" Then
response.write Session( "ASPDB_1007_ContactID" )
DSQL = "SELECT tblPubs.PubID, tblPubs.Title, tblPubs.PType, tblTargets.Target, tblPubs.Status " & _
"FROM (tblContacts INNER JOIN (tblPubs INNER JOIN tblAuthors ON tblPubs.PubID = tblAuthors.PubID) " & _
"ON tblContacts.ContactID = tblAuthors.ContactID) INNER JOIN tblTargets ON tblPubs.TargetID = tblTargets.targetID " & _
"WHERE (((tblContacts.ContactID)=" & Session( "ASPDB_1007_ContactID" ) & ")"
Set D = Server.CreateObject("ASP.db"
D.dbUnit = 1008
D.dbDSN = "Epubs"
D.dbMode = "Grid"
D.dbSQL = DSQL
D.dbGridTableTag = "Border=1"
D.dbGridIndex = False
D.dbGridInc = "6"
D.dbGridDisplayFlds = "0,1,2,3,4"
D.dbOptions = "HeaderFontTag=Face=Verdana Size=2, CellFontTag=Face=Verdana Size=2"
D.dbNavigation = "Bottom"
D.dbNavigationItem="grid, top, prev, next, bottom, row+, row-, grid+, grid-, form+, form-, filter, resetfilter, download, color, reload"
D.dbNavigationIcon="std"
D.dbExportFlds = "PubID"
D.dbImageDir="images/"
D.dbNameMap = "PType, Pub Type"
'D.dbMagicCell = "2,,<A HREF=pubs.asp?PUB=#(1)#>#(2)#</A>"
D.dbSuppressMsg = True
D.dbstatusBar = False
D.ASPdb
response.write DSQL
End If
%>
-
Only getting first record in grid (reply)
Thanks Mark, that did the trick. I appreciate the quick response.
Regards,
Larry
------------
Mark at 2/20/01 1:13:29 PM
Larry,
You must add a D.dbReset(1008) after the
If D.dbUnit = 1008
because your Where clause has a variable in it.
Also, for testing, I suggest you set SuppressMsg=False and StatusBar=True.
Try that and see if it helps. Let me know, thanks,
Mark.
------------
Larry G at 2/20/01 12:58:37 PM
Hi,
I have a page that displays a grid and when the index is clicked through to the form page, there will be a second grid which relies on an Export field from grid 1. For some reason, grid 2 will only show the first record from the recordset and show a 1 - 1: 1 in the Status Bar while I'm certain there are more than one record. I've response.write the SQL and pasted it into a query in Access and it always returns all of the records. Why would this happen?
Thanks,
Larry
<%
ASQL = "SELECT tblContacts.ContactID, tblContacts.LastName, tblContacts.FirstName, Count(tblPubs.PubID) AS PubCount " & _
"FROM (tblAuthors INNER JOIN tblContacts ON tblAuthors.ContactID = tblContacts.ContactID) INNER JOIN tblPubs ON tblAuthors.PubID = tblPubs.PubID " & _
"GROUP BY tblContacts.ContactID, tblContacts.LastName, tblContacts.FirstName"
Set A = Server.CreateObject("ASP.db"
A.dbUnit = 1007
A.dbDSN = "Epubs"
A.dbMode = "Both"
A.dbSQL = ASQL
A.dbGridTableTag = "Border=0"
A.dbGridIndex = False
A.dbGridCol = "3"
A.dbGridInc = "6"
A.dbFormDisplayFlds = "2,3"
A.dbNavigation = "None"
A.dbOptions = "HeaderFontTag=Face=Verdana Size=2, CellFontTag=Face=Verdana Size=2"
A.dbNavigation = "Top"
A.dbNavigationItem="grid, form, top, prev, next, bottom, row+, row-, grid+, grid-, form+, form-, filter, resetfilter, download, color, reload"
A.dbNavigationIcon="std"
A.dbExportFlds = "ContactID"
A.dbImageDir="images/"
A.dbNameMap = "FirstName,Author;PubCount, Pub Count"
A.dbMagicCell = "FirstName,,#FirstName# #LastName#, index;PubCount,align=center"
A.dbGridDisplayFlds = "FirstName, PubCount"
A.dbSuppressMsg = True
A.ASPdb
If A.dbLastScreen = "form" Then
response.write Session( "ASPDB_1007_ContactID" )
DSQL = "SELECT tblPubs.PubID, tblPubs.Title, tblPubs.PType, tblTargets.Target, tblPubs.Status " & _
"FROM (tblContacts INNER JOIN (tblPubs INNER JOIN tblAuthors ON tblPubs.PubID = tblAuthors.PubID) " & _
"ON tblContacts.ContactID = tblAuthors.ContactID) INNER JOIN tblTargets ON tblPubs.TargetID = tblTargets.targetID " & _
"WHERE (((tblContacts.ContactID)=" & Session( "ASPDB_1007_ContactID" ) & ")"
Set D = Server.CreateObject("ASP.db"
D.dbUnit = 1008
D.dbDSN = "Epubs"
D.dbMode = "Grid"
D.dbSQL = DSQL
D.dbGridTableTag = "Border=1"
D.dbGridIndex = False
D.dbGridInc = "6"
D.dbGridDisplayFlds = "0,1,2,3,4"
D.dbOptions = "HeaderFontTag=Face=Verdana Size=2, CellFontTag=Face=Verdana Size=2"
D.dbNavigation = "Bottom"
D.dbNavigationItem="grid, top, prev, next, bottom, row+, row-, grid+, grid-, form+, form-, filter, resetfilter, download, color, reload"
D.dbNavigationIcon="std"
D.dbExportFlds = "PubID"
D.dbImageDir="images/"
D.dbNameMap = "PType, Pub Type"
'D.dbMagicCell = "2,,<A HREF=pubs.asp?PUB=#(1)#>#(2)#</A>"
D.dbSuppressMsg = True
D.dbstatusBar = False
D.ASPdb
response.write DSQL
End If
%>
-
Only getting first record in grid (reply)
Mark,
One problem. The addition of D.dbReset(1008) looks like it has broken the grids paging. If the SQL returns 30 records and I'm displaying in incriments of 5, clicking the Next button doesn't do anything. Any thoughts?
Thanks again,
Larry
------------
Mark at 2/20/01 1:13:29 PM
Larry,
You must add a D.dbReset(1008) after the
If D.dbUnit = 1008
because your Where clause has a variable in it.
Also, for testing, I suggest you set SuppressMsg=False and StatusBar=True.
Try that and see if it helps. Let me know, thanks,
Mark.
------------
Larry G at 2/20/01 12:58:37 PM
Hi,
I have a page that displays a grid and when the index is clicked through to the form page, there will be a second grid which relies on an Export field from grid 1. For some reason, grid 2 will only show the first record from the recordset and show a 1 - 1: 1 in the Status Bar while I'm certain there are more than one record. I've response.write the SQL and pasted it into a query in Access and it always returns all of the records. Why would this happen?
Thanks,
Larry
<%
ASQL = "SELECT tblContacts.ContactID, tblContacts.LastName, tblContacts.FirstName, Count(tblPubs.PubID) AS PubCount " & _
"FROM (tblAuthors INNER JOIN tblContacts ON tblAuthors.ContactID = tblContacts.ContactID) INNER JOIN tblPubs ON tblAuthors.PubID = tblPubs.PubID " & _
"GROUP BY tblContacts.ContactID, tblContacts.LastName, tblContacts.FirstName"
Set A = Server.CreateObject("ASP.db"
A.dbUnit = 1007
A.dbDSN = "Epubs"
A.dbMode = "Both"
A.dbSQL = ASQL
A.dbGridTableTag = "Border=0"
A.dbGridIndex = False
A.dbGridCol = "3"
A.dbGridInc = "6"
A.dbFormDisplayFlds = "2,3"
A.dbNavigation = "None"
A.dbOptions = "HeaderFontTag=Face=Verdana Size=2, CellFontTag=Face=Verdana Size=2"
A.dbNavigation = "Top"
A.dbNavigationItem="grid, form, top, prev, next, bottom, row+, row-, grid+, grid-, form+, form-, filter, resetfilter, download, color, reload"
A.dbNavigationIcon="std"
A.dbExportFlds = "ContactID"
A.dbImageDir="images/"
A.dbNameMap = "FirstName,Author;PubCount, Pub Count"
A.dbMagicCell = "FirstName,,#FirstName# #LastName#, index;PubCount,align=center"
A.dbGridDisplayFlds = "FirstName, PubCount"
A.dbSuppressMsg = True
A.ASPdb
If A.dbLastScreen = "form" Then
response.write Session( "ASPDB_1007_ContactID" )
DSQL = "SELECT tblPubs.PubID, tblPubs.Title, tblPubs.PType, tblTargets.Target, tblPubs.Status " & _
"FROM (tblContacts INNER JOIN (tblPubs INNER JOIN tblAuthors ON tblPubs.PubID = tblAuthors.PubID) " & _
"ON tblContacts.ContactID = tblAuthors.ContactID) INNER JOIN tblTargets ON tblPubs.TargetID = tblTargets.targetID " & _
"WHERE (((tblContacts.ContactID)=" & Session( "ASPDB_1007_ContactID" ) & ")"
Set D = Server.CreateObject("ASP.db"
D.dbUnit = 1008
D.dbDSN = "Epubs"
D.dbMode = "Grid"
D.dbSQL = DSQL
D.dbGridTableTag = "Border=1"
D.dbGridIndex = False
D.dbGridInc = "6"
D.dbGridDisplayFlds = "0,1,2,3,4"
D.dbOptions = "HeaderFontTag=Face=Verdana Size=2, CellFontTag=Face=Verdana Size=2"
D.dbNavigation = "Bottom"
D.dbNavigationItem="grid, top, prev, next, bottom, row+, row-, grid+, grid-, form+, form-, filter, resetfilter, download, color, reload"
D.dbNavigationIcon="std"
D.dbExportFlds = "PubID"
D.dbImageDir="images/"
D.dbNameMap = "PType, Pub Type"
'D.dbMagicCell = "2,,<A HREF=pubs.asp?PUB=#(1)#>#(2)#</A>"
D.dbSuppressMsg = True
D.dbstatusBar = False
D.ASPdb
response.write DSQL
End If
%>
-
Only getting first record in grid (reply)
Larry,
Yes, only do the dbReset IF and WHEN the Where clause changes.
In other words ... whenever Session("ASPDB_1007_ContactID" changes.
Mark.
------------
Larry G at 2/20/01 2:04:23 PM
Mark,
One problem. The addition of D.dbReset(1008) looks like it has broken the grids paging. If the SQL returns 30 records and I'm displaying in incriments of 5, clicking the Next button doesn't do anything. Any thoughts?
Thanks again,
Larry
------------
Mark at 2/20/01 1:13:29 PM
Larry,
You must add a D.dbReset(1008) after the
If D.dbUnit = 1008
because your Where clause has a variable in it.
Also, for testing, I suggest you set SuppressMsg=False and StatusBar=True.
Try that and see if it helps. Let me know, thanks,
Mark.
------------
Larry G at 2/20/01 12:58:37 PM
Hi,
I have a page that displays a grid and when the index is clicked through to the form page, there will be a second grid which relies on an Export field from grid 1. For some reason, grid 2 will only show the first record from the recordset and show a 1 - 1: 1 in the Status Bar while I'm certain there are more than one record. I've response.write the SQL and pasted it into a query in Access and it always returns all of the records. Why would this happen?
Thanks,
Larry
<%
ASQL = "SELECT tblContacts.ContactID, tblContacts.LastName, tblContacts.FirstName, Count(tblPubs.PubID) AS PubCount " & _
"FROM (tblAuthors INNER JOIN tblContacts ON tblAuthors.ContactID = tblContacts.ContactID) INNER JOIN tblPubs ON tblAuthors.PubID = tblPubs.PubID " & _
"GROUP BY tblContacts.ContactID, tblContacts.LastName, tblContacts.FirstName"
Set A = Server.CreateObject("ASP.db"
A.dbUnit = 1007
A.dbDSN = "Epubs"
A.dbMode = "Both"
A.dbSQL = ASQL
A.dbGridTableTag = "Border=0"
A.dbGridIndex = False
A.dbGridCol = "3"
A.dbGridInc = "6"
A.dbFormDisplayFlds = "2,3"
A.dbNavigation = "None"
A.dbOptions = "HeaderFontTag=Face=Verdana Size=2, CellFontTag=Face=Verdana Size=2"
A.dbNavigation = "Top"
A.dbNavigationItem="grid, form, top, prev, next, bottom, row+, row-, grid+, grid-, form+, form-, filter, resetfilter, download, color, reload"
A.dbNavigationIcon="std"
A.dbExportFlds = "ContactID"
A.dbImageDir="images/"
A.dbNameMap = "FirstName,Author;PubCount, Pub Count"
A.dbMagicCell = "FirstName,,#FirstName# #LastName#, index;PubCount,align=center"
A.dbGridDisplayFlds = "FirstName, PubCount"
A.dbSuppressMsg = True
A.ASPdb
If A.dbLastScreen = "form" Then
response.write Session( "ASPDB_1007_ContactID" )
DSQL = "SELECT tblPubs.PubID, tblPubs.Title, tblPubs.PType, tblTargets.Target, tblPubs.Status " & _
"FROM (tblContacts INNER JOIN (tblPubs INNER JOIN tblAuthors ON tblPubs.PubID = tblAuthors.PubID) " & _
"ON tblContacts.ContactID = tblAuthors.ContactID) INNER JOIN tblTargets ON tblPubs.TargetID = tblTargets.targetID " & _
"WHERE (((tblContacts.ContactID)=" & Session( "ASPDB_1007_ContactID" ) & ")"
Set D = Server.CreateObject("ASP.db"
D.dbUnit = 1008
D.dbDSN = "Epubs"
D.dbMode = "Grid"
D.dbSQL = DSQL
D.dbGridTableTag = "Border=1"
D.dbGridIndex = False
D.dbGridInc = "6"
D.dbGridDisplayFlds = "0,1,2,3,4"
D.dbOptions = "HeaderFontTag=Face=Verdana Size=2, CellFontTag=Face=Verdana Size=2"
D.dbNavigation = "Bottom"
D.dbNavigationItem="grid, top, prev, next, bottom, row+, row-, grid+, grid-, form+, form-, filter, resetfilter, download, color, reload"
D.dbNavigationIcon="std"
D.dbExportFlds = "PubID"
D.dbImageDir="images/"
D.dbNameMap = "PType, Pub Type"
'D.dbMagicCell = "2,,<A HREF=pubs.asp?PUB=#(1)#>#(2)#</A>"
D.dbSuppressMsg = True
D.dbstatusBar = False
D.ASPdb
response.write DSQL
End If
%>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|