CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 SQL/ASP Certain Fields are not Displayed

Print topic Send  topic

Author Message
BillatCUAA
Posted: 04/03/2003, 5:43 AM

I am using SQL Server 7, ASP. I generate this page and the field named article does not appear on the page. Within CCS2.0 I can view the data in the query and it appears, but when I view the page, article is a no show. I have this problem with several pages. Any suggestions are appreciated. ASP code is attached.

<%
'Include Common Files @1-D6EDE132
%>
<!-- #INCLUDE FILE=".\Common.asp"-->
<!-- #INCLUDE FILE=".\Cache.asp" -->
<!-- #INCLUDE FILE=".\Template.asp" -->
<!-- #INCLUDE FILE=".\Sorter.asp" -->
<!-- #INCLUDE FILE=".\Navigator.asp" -->
<%
'End Include Common Files

'Initialize Page @1-0F5D0B55
' Variables
Dim PathToRoot, ScriptPath
Dim FileName
Dim Redirect
Dim Tpl, HTMLTemplate
Dim TemplateFileName
Dim ComponentName
Dim PathToCurrentPage

' Events
Dim CCSEvents
Dim CCSEventResult

' Connections
Dim DBIntranet

' Page controls
Dim Header
Dim latestnews1

Redirect = ""
TemplateFileName = "Headlines.html"
Set CCSEvents = CreateObject("Scripting.Dictionary")
PathToCurrentPage = "./"
FileName = "Headlines.asp"
PathToRoot = "./"
ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName))
'End Initialize Page

'Initialize Objects @1-6272F947
Set DBIntranet = New clsDBIntranet
DBIntranet.Open

' Controls
Set Header = New clsHeader
Header.BindEvents
Header.Initialize
Set latestnews1 = New clsGridlatestnews1
latestnews1.Initialize DBIntranet

' Events
%>
<!-- #INCLUDE FILE="Headlines_events.asp" -->
<%
BindEvents

CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing)
'End Initialize Objects

'Execute Components @1-D491FF66
Header.Operations
'End Execute Components

'Go to destination page @1-6D35F4FD
If NOT ( Redirect = "" ) Then
UnloadPage
Response.Redirect Redirect
End If
'End Go to destination page

'Initialize HTML Template @1-0155E1BE
CCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing)
Set HTMLTemplate = new clsTemplate
Set HTMLTemplate.Cache = TemplatesRepository
HTMLTemplate.LoadTemplate ScriptPath & TemplateFileName
Set Tpl = HTMLTemplate.Block("main")
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Nothing)
'End Initialize HTML Template

'Show Page @1-16297794
Header.Show Tpl, "Header"
latestnews1.Show Tpl
HTMLTemplate.PParse "main", False
'End Show Page

'Unload Page @1-CB210C62
UnloadPage
Set Tpl = Nothing
Set HTMLTemplate = Nothing
'End Unload Page

'UnloadPage Sub @1-C3EE5B15
Sub UnloadPage()
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing)
If DBIntranet.State = adStateOpen Then _
DBIntranet.Close
Set DBIntranet = Nothing
Set Header = Nothing
Set latestnews1 = Nothing
End Sub
'End UnloadPage Sub

'Include Page Implementation @9-EB31621C
%>
<!-- #INCLUDE FILE="Header.asp" -->
<%
'End Include Page Implementation

Class clsGridlatestnews1 'latestnews1 Class @77-367F3B4E

'latestnews1 Variables @77-A801B9F3

' Public variables
Public ComponentName, CCSEvents
Public Visible, Errors
Public DataSource, PageSize
Public PageNumber
Public Command
Public TemplateBlock
Public ActiveSorter, SortingDirection
Public Recordset

Private CCSEventResult

' Grid Controls
Public StaticControls, RowControls
Dim Sorter_submitdate
Dim Sorter_title
Dim submitdate
Dim title
Dim article
Dim Navigator
'End latestnews1 Variables

'latestnews1 Class_Initialize Event @77-D30CD550
Private Sub Class_Initialize()
ComponentName = "latestnews1"
Visible = True
Set CCSEvents = CreateObject("Scripting.Dictionary")
Set Errors = New clsErrors
Set DataSource = New clslatestnews1DataSource
Set Command = New clsCommand
PageSize = CCGetParam(ComponentName & "PageSize", Empty)
If IsNumeric(PageSize) And Len(PageSize) > 0 Then
If PageSize=0 Then Errors.AddError("(CCS06) Invalid page size.")
End If
If NOT IsNumeric(PageSize) OR IsEmpty(PageSize) Then _
PageSize = 10 _
Else _
PageSize = CInt(PageSize)
PageNumber = CInt(CCGetParam(ComponentName & "Page", 1))
ActiveSorter = CCGetParam("latestnews1Order", Empty)
SortingDirection = CCGetParam("latestnews1Dir", Empty)
If NOT(SortingDirection = "ASC" OR SortingDirection = "DESC") Then _
SortingDirection = Empty

Set submitdate = CCCreateControl(ccsLabel, "submitdate", "submitdate", ccsDate, Empty, CCGetRequestParam("submitdate", ccsGet))
submitdate.DBFormat = Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss")
Set title = CCCreateControl(ccsLabel, "title", "title", ccsText, Empty, CCGetRequestParam("title", ccsGet))
Set article = CCCreateControl(ccsLabel, "article", "article", ccsMemo, Empty, CCGetRequestParam("article", ccsGet))
Set Sorter_submitdate = CCCreateSorter("Sorter_submitdate", Me, FileName)
Set Sorter_title = CCCreateSorter("Sorter_title", Me, FileName)
Set Navigator = CCCreateNavigator(ComponentName, "Navigator", FileName, 10, tpCentered)
End Sub
'End latestnews1 Class_Initialize Event

'latestnews1 Initialize Method @77-2AEA3975
Sub Initialize(objConnection)
If NOT Visible Then Exit Sub

Set DataSource.Connection = objConnection
DataSource.PageSize = PageSize
DataSource.SetOrder ActiveSorter, SortingDirection
DataSource.AbsolutePage = PageNumber
End Sub
'End latestnews1 Initialize Method

'latestnews1 Class_Terminate Event @77-E1528F98
Private Sub Class_Terminate()
Set DataSource = Nothing
Set Command = Nothing
Set Errors = Nothing
End Sub
'End latestnews1 Class_Terminate Event

'latestnews1 Show Method @77-CBC2F825
Sub Show(Tpl)
If NOT Visible Then Exit Sub

Dim RecordCounter, ShownRecords
Dim RowBlock

With DataSource
End With

CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me)
Set Recordset = DataSource.Open(Command)

Set TemplateBlock = Tpl.Block("Grid " & ComponentName)
Set RowBlock = TemplateBlock.Block("Row")
Set StaticControls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _
Array(Sorter_submitdate, Sorter_title, Navigator))
Set RowControls = CCCreateCollection(RowBlock, Null, ccsParseAccumulate, _
Array(submitdate, title, article))

CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me)
If NOT Visible Then Exit Sub

Errors.AddErrors DataSource.Errors
If Errors.Count > 0 Then
TemplateBlock.HTML = CCFormatError("Grid latestnews1", Errors)
Else

' Show NoRecords block if no records are found
If Recordset.EOF Then
TemplateBlock.Block("NoRecords").Parse ccsParseOverwrite
End If
While NOT Recordset.EOF AND ShownRecords < PageSize
submitdate.Value = Recordset.Fields("submitdate")
title.Value = Recordset.Fields("title")
article.Value = Recordset.Fields("article")
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me)
RowControls.Show
Recordset.MoveNext
ShownRecords = ShownRecords + 1
Wend
Navigator.SetDataSource Recordset
StaticControls.Show
End If

End Sub
'End latestnews1 Show Method

End Class 'End latestnews1 Class @77-A61BA892

Class clslatestnews1DataSource 'latestnews1DataSource Class @77-82BD5669

'DataSource Variables @77-C95C8B76
Public Errors, Connection, Parameters, CCSEvents

Public Recordset
Public SQL, CountSQL, Order, Where, Orders
Public RecordsCount
Public PageSize
Public PageCount
Public AbsolutePage
Public Fields
Dim WhereParameters
Public AllParamsSet

Private CurrentOperation
Private CCSEventResult

' Datasource fields
Public submitdate
Public title
Public article
'End DataSource Variables

'DataSource Class_Initialize Event @77-1366A553
Private Sub Class_Initialize()

Set CCSEvents = CreateObject("Scripting.Dictionary")
Set Fields = New clsFields
Set Recordset = New clsDataSource
Set Errors = New clsErrors
AllParamsSet = True
Set submitdate = CCCreateField("submitdate", "submitdate", ccsDate, Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"), Recordset)
Set title = CCCreateField("title", "title", ccsText, Empty, Recordset)
Set article = CCCreateField("article", "article", ccsMemo, Empty, Recordset)
Fields.AddFields Array(submitdate, title, article)
Orders = Array( _
Array("Sorter_submitdate", "submitdate", ""), _
Array("Sorter_title", "title", ""))

SQL = "SELECT * " & _
"FROM latestnews"
CountSQL = "SELECT COUNT(*) " & _
"FROM latestnews"
Where = ""
Order = ""
End Sub
'End DataSource Class_Initialize Event

'SetOrder Method @77-68FC9576
Sub SetOrder(Column, Direction)
Order = Recordset.GetOrder(Order, Column, Direction, Orders)
End Sub
'End SetOrder Method

'BuildTableWhere Method @77-98E5A92F
Public Sub BuildTableWhere()
End Sub
'End BuildTableWhere Method

'Open Method @77-D0383B6E
Function Open(Cmd)
Errors.Clear
Set Recordset.DataSource = Me
Set Cmd.Connection = Connection
Cmd.CommandOperation = cmdOpen
Cmd.PageSize = PageSize
Cmd.ActivePage = AbsolutePage
Cmd.CommandType = dsTable
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildSelect", Me)
Cmd.SQL = SQL
Cmd.CountSQL = CountSQL
Cmd.Where = Where
Cmd.OrderBy = Order
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteSelect", Me)
If Errors.Count = 0 And CCSEventResult Then _
Set Recordset = Cmd.Exec(Errors)
CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteSelect", Me)
Set Recordset.FieldsCollection = Fields
Set Open = Recordset
End Function
'End Open Method

'DataSource Class_Terminate Event @77-41B4B08D
Private Sub Class_Terminate()
If Recordset.State = adStateOpen Then _
Recordset.Close
Set Recordset = Nothing
Set Parameters = Nothing
Set Errors = Nothing
End Sub
'End DataSource Class_Terminate Event

End Class 'End latestnews1DataSource Class @77-A61BA892





%>
BillatCuaa
Posted: 04/03/2003, 10:25 AM

I changed the connection string for the database and it is working fine. For some reason the ODBC connector was not returning all rows. Don't have time to figure it out now, but bypassing ODBC made everything work.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.