Paging In Datareport
Hello,
i am querying from a table which contain about 1500 records. I want to display only 20 records in each page of the datareport. here is the code i am using. i want to show only one page at a time. I am using a "View Previous" and "View Next" Buttons to display each block of records. It displays all the 1500 records. pls pointout wat is wrong in my code.
Code: Dim rsCustomerReceiptReport As New ADODB.Recordset Dim intPageCounter As Integer Private Sub Form_Load() If rsCustomerReceiptReport.State Then rsCustomerReceiptReport.Close rsCustomerReceiptReport.CursorLocation = adUseClient rsCustomerReceiptReport.PageSize = 20 rsCustomerReceiptReport.CacheSize = 20 rsCustomerReceiptReport.Open "SELECT * FROM CustomerMaster", cnTradeLinks, adOpenForwardOnly intPageCounter = 1 End Sub
Private Sub cmdViewPrevious_Click() On Error GoTo ErrH Unload drReceiptDetails intPageCounter = intPageCounter - 1 If intPageCounter = 0 Then intPageCounter = 1 rsCustomerReceiptReport.AbsolutePage = intPageCounter rsCustomerReceiptReport.AbsolutePosition = intPageCounter Set drReceiptDetails.DataSource = rsCustomerReceiptReport drReceiptDetails.Show ErrH: If Err.Number <> 0 Then Err.Number = 0 End If End Sub
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Datareport Paging Issues (Anyone Can Helpt Me?)
Hello !
I am Rakesh. I have developed an inventory control program.
The program keeps record of work done by workers with Item produced by them.
Now i am facing problem with Datareport. Report have Group Header, Detail Section and Group Footer.
Group Header contains Heading part of the fields. Details section contains details of work done by worker sorted by item produced.
Now what happen is everytime the no. of records or item produced by worker is not fixed, they are various each time.
Now i need to show the details of one work on single page including header, details and footer.
Now it has shown record of 1 worker. it takes half page. Now it start showing 2 worker which have more than 10 records
and some of them are moved to second page and footer comes to next page.
Now if worker 2's details section should be come on single page. it should not wrap. I have used Rectangle and Line shapes in reports.
This issue is of records wrapping to next page.
Anyone can help to comeout of this f... issue... IT IS VERY URGENT.
VERY URGENT.
Thanks.
Okay, Here's Paging In SQL.
-----------------------------------------------------------------------------------
--Here's a complete SP in SQL that will allow the applications to
--implement table/grid paging. This paging will be done in SQL
--itself so applications won't have to use ADO paging. This
--provides performance enhancements, I guess.
--Create this SP in your DB and pass it the required Parameters
--which are pretty self explanatory and it should return you only
--the desired page. This will work with any Table/View/UDF. It will
--also return you total recordcount and an unique column(if the
--table does not already have one).
--Please let me know of any bugs (shouldn't be there) or
--performace enhancements you can think of here.
-----------------------------------------------------------------------------------
CREATE PROCEDURE DBO.USP_Table_Paging
(
--Declare
@Page int,
@PageSize int,
@FieldsvarChar(3000),
@Table sysname,
@Where varChar(900),
@OrderBy varChar(100)
)
AS
--
-- Set @Page = 2
-- Set@PageSize = 20
-- Set@Fields='*'
-- Set@Table ='[Order Details]'
-- Set@Where = ''
-- Set@OrderBy=''
Declare @PreviousRows int,
@RowsReviewed int,
@strSQL nvarchar(4000)
Set @RowsReviewed = @PageSize * @page
Set @PreviousRows = @RowsReviewed - @PageSize
Declare @Identity_Column varchar(100)
Declare @ValidTable int
if exists (select * from dbo.sysobjects where id = object_id(N'[#tempPaging]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [#tempPaging]
Select @ValidTable = ID From sysobjects Where Type='u' and Name= + @Table
If (@ValidTable Is Not Null)
Begin
Select @Identity_Column = Name From syscolumns Where Id=(Select Id From sysobjects Where Type='u' and Name= + @Table) And Autoval Is Not Null
End
Set @strSql = ''
If(@Identity_Column Is null OR @ValidTable Is Null)
Begin
Set @Identity_Column = 'ID_Num'
Set @strSQL ='Declare @Identity_Column varchar(100) '
If(@Where<>'')
Begin
Set @strSQL=@strSQL+Char(13)+ 'Select Top ' + Convert(varchar(100), @RowsReviewed) + ' ' + @Fields + ', (Select count(*) From ' + @Table + ' WHERE ' + @Where + ') as RecordCount, '
Set @strSQL=@strSQL+Char(13)+ 'IDENTITY(int, 1,1) AS ID_Num '
Set @strSQL=@strSQL+Char(13)+ 'INTO #tempPaging From ' + @table + ' '
Set @strSQL=@strSQL+Char(13)+ 'WHERE ' + @Where
End
Else
Begin
Set @strSQL=@strSQL+Char(13)+ 'Select Top ' + Convert(varchar(100), @RowsReviewed) + ' ' + @Fields + ',(Select count(*) From ' + @Table + ') as RecordCount, '
Set @strSQL=@strSQL+Char(13)+ 'IDENTITY(int, 1,1) AS ID_Num '
Set @strSQL=@strSQL+Char(13)+ 'INTO #tempPaging From ' + @table
End
If(@OrderBy<>'')
Begin
Set @strSQL=@strSQL+Char(13)+ 'ORDER BY ' + @OrderBy
End
End
Else
Begin
If(@Where<>'')
Begin
Set @strSQL=@strSQL+Char(13)+ 'Select Top ' + Convert(varchar(100), @RowsReviewed) + ' ' + @Fields + ', (Select count(*) From ' + @Table + ' WHERE ' + @Where + ') as RecordCount '
Set @strSql = @strSql + 'INTO #tempPaging '
Set @strSql = @strSql + 'FROM ' + @Table + ' '
Set @strSQL=@strSQL+Char(13)+ 'WHERE ' + @Where
End
Else
Begin
Set @strSQL=@strSQL+Char(13)+ 'Select Top ' + Convert(varchar(100), @RowsReviewed) + ' ' + @Fields + ', (Select count(*) From ' + @Table + ') as RecordCount '
Set @strSQL=@strSQL+Char(13)+ 'INTO #tempPaging From ' + @table
End
If(@OrderBy<>'')
Begin
Set @strSQL=@strSQL+Char(13)+'ORDER BY ' + @OrderBy
End
End
If (@RowsReviewed = @PageSize)
BEGIN
Set @strSql = @strSql +Char(13)+ 'Select * '
Set @strSql = @strSql + 'FROM #tempPaging '
Set @strSql = @strSql + Char(13)+ 'Drop Table #tempPaging '
END
ELSE
BEGIN
Set @strSql = @strSql + Char(13) + 'Delete From #tempPaging Where ' + @Identity_Column + ' '
Set @strSql = @strSql + Char(13) + 'In (Select Top ' + Convert(varchar(100),@RowsReviewed - @PageSize) + ' ' + @Identity_Column + ' From #tempPaging )'
Set @strSql = @strSql + Char(13) + 'Select * From #tempPaging '
-- Set @strSql = @strSql + Char(13)+ 'Select TOP ' + CONVERT(varChar, @PageSize) + ' * '
-- Set @strSql = @strSql + 'FROM #tempPaging '
-- Set @strSql = @strSql + 'WHERE ' + @Identity_Column + ' IN '
-- Set @strSql = @strSql + '(Select TOP ' + CONVERT(varChar, @RowsReviewed) + ' ' + @Identity_Column + ' '
-- Set @strSql = @strSql + 'FROM #tempPaging ) '
-- Set @strSql = @strSql + 'AND ' + @Identity_Column + ' NOT IN '
-- Set @strSql = @strSql + '(Select TOP ' + CONVERT(varChar, @PreviousRows) + ' ' + @Identity_Column + ' '
-- Set @strSql = @strSql + 'FROM #tempPaging ) '
--
Set @strSql = @strSql + Char(13) + 'Drop Table #tempPaging '
END
execute sp_ExecuteSQL @strsql
--print @strSql
GO
-----------------------------------------------------------------------------------
Please, let me know if there is a possibility for performace enhancement here. That is my whole purpose of posting this code in this section.
Numeric Paging
I have a pretty big project coming up at work and need some tips. I am developing Help Desk Software for the Company I work for. It will be located on the company intranet with a web interface. There will be 4 levels of urgency for requesting support. When someone in the building requests the most urgent level, I need a numeric page to be sent to a couple of regular numeric pagers. I was told that I could write a batch file that could send a page with some built in windows paging component. Another option would be to use a VB program with the MSComm component, and I also heard that SQL SERVER has a built in function that will send numeric pages by a command line. My question is what would be the easiest and most logical way to do this?
Also, whatever sends the page does not need to recieve any variables or input from the software. It just needs to send a page to the number it is specified when it is executed.
Paging In Word Thru VB
how do I write a line of text to a certain spot on the Word document. For example, each page has its own title. How do I do that in VB?
Setting Up Paging In Vb
Hi heroes,
I am not sure if this is the right forum for this thread. If not, please let me know.
I am trying to set up paging in vb so we can have Next, Previous, navigation controls in vb.
Can anyone share with me the process of doing this?
Any with info will also be appreciated.
Thanks
Datagrid Paging
How do you code the datagrid when you allow paging for it to change data in the grid and go to the next page when you click on the number?
Paging Of Records
Hello Guys! Maybe some of you has already an answer on my question (if this is possible).
In internet, we can simply break the records into several pages...(Page may contain 50 records each). So i wonder if there is a way to do this in VB by using any display control (FlexGrid, Datagrid, etc). I hope you get my point here.
Thanks
Paging... With Ado Recordsets And VB
The query consist of 6 columns of data... The entire table consist of 57000 records, I don't want to pull all of the data at once cause I only have realestate for maybe 75-100 records at a time on the screen. I have been trying paging with hopes that it will speed up this query as well. However even when using paging the query still takes just as long as it would to pull all 57000 rows of data.
What do I need to do to get the performance out of paging? Below is the code that I am using to handle this issue thanks. Early I tried to just send a T-sql statement and it still took the same amount of time. Additionally I tried to do the same with stored procedures on the sql server and it still didn't improve performance. Any suggestions? Where have I gone wrong?
Private Sub Command1_Click()
Dim rst As New ADODB.Recordset
Dim cnn As New ADODB.Connection
cnn.ConnectionString = cstCNN
cnn.CursorLocation = adUseClient
cnn.Open
rst.PageSize = 10
Set rst = GetView(cnn, "vwInventoryAll")
cnn.Close
Set rst = Nothing
Set cnn = Nothing
End Sub
------------------------------------------------------------------
Private Function GetView(cnn As ADODB.Connection, strViewName As String) As ADODB.Recordset
Dim cmd As New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdTable
cmd.CommandText = strViewName
Set GetView = cmd.Execute
Set cmd = Nothing
End Function
Paging DataGrid ?
hello all,
i want to paging my datagrid.
anyone have an idea ?
i'm use Adodc
Regards
MySQL Paging
Hi to all,
I need some advice/help on a mySQL paging function that I am doing right now. You see, I try to mimic the paging recordset of ADO. But since I am using mySQL, what I try to implement is using its LIMIT and OFFSET extension clause.
Like for example I try to download I number of records and then have a 'move next' functionality by implementing a SELECT sql clause which just limits the records to be returned by 1. So anytime the user clicks the 'move next' button, it does not necessarily call the Recordset's MoveNext method but rather selects a single records and select again another if the user still clicks the 'move next' button. I was able to do this with the help of the OFFSET clause which remembers it last value through a module level variable.
Ex:
Code:
mlngOffset = mlngOffset + 1
strSQL ="SELECT * FROM table LIMIT 1 OFFSET " & mlngOffset
Set rec = New ADODB.Recordset
rec.Open strSQL, conn
Me.text1 = rec(0)
Me.text2 = rec(1)
There, If the user again clicks the 'move next button', it just increases the value, if 'move previous', decrements the value. But my problem is that, if this is in a multi-user scenario, and many users are also viewing and deleting records, what will happen if the current offset will exceed the total record count?
Like in those web pages, they have that kind of functionality right. Do you think that every time we click the move next or move previous button, the pages we requested are refreshed?
Thanks and god bless all!
Paging A Query
i have a query that returns like 500 records. This recordset i show it in a datagrid. My question is this: is there any way i could "navigate" threw the query, so i do not have to see the 500 records in the same screen? Like, "paging" the recordset or something like that. So i could see 50 records per page or something like that? or just to query the first 50 records, then the records 51 to 100 and so on?
im working with ms-sql and, obviously, VB6.
I do not know if i make my self clear, if u need any more data please ask for it.
thx,
aStor
pd: im a little bit rusty in english, im from argentina
Recordset Paging?
Hi
I've recently used DataPaging/recordset paging in ASP.Can the same thing be done in VB6,using the Webcontrol? without using
ASP only VBcode and HTML.
Thanks
Paging From MS Outlook
hey guys and gals..
I wanted to write an interface/program that you could set a person's pager number for ms outlook and it would page that person every time there was a calendered appointment set.
maybe you could have a variable that you could set as to how far ahead of time you would have it page the person.
but, it would actually send the text of the meeting/appointment from outlook to the pager.
And it pages the person by sending an email to the persons pager-email address such as :
http://3105556604@alphapage.airtouch.com
any ideas where to start ?
I am rather new to VB 6
thanks,
Kevin Rea
krea@socal.rr.com
Paging Through Records
i need some help what it is i have a program that after a query is made will display all the records for that search. but some times the records could be 100.
i currently have them listed in a list using the listview.
is there any way of say having 10 records and then click on a button and the next comes up, either in listview or something else.
any suggestions?
Datagrid Paging
hie, can someone pls help me with the problem i faced with the datagrid paging ?
the msg error occur when i click on the second page of the datagrid ....
the msg error is Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount.
my coding is as below :
Private Sub DataGrid1_PageIndexChanged(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles DataGrid1.PageIndexChanged
Dim ds1 As New DataSet
Dim da1 As New SqlClient.SqlDataAdapter("select tblmember.username, tblmember.memberphoto_path, tblpayment.aboutme from tblmember, tblpayment where tblmember.paymentid = tblpayment.paymentid AND tblmember.gender = '" & txtgender.Text & "'", conn)
da1.Fill(ds1)
DataGrid1.CurrentPageIndex = e.NewPageIndex
DataGrid1.DataSource = ds1
DataGrid1.DataBind()
pls kindly assists me on this problem....
thanks...
regards,
karenlim
DataGrid Paging
Hi all,
I'm working with a datagrid in VB .NET and I want to set up paging to only
display a specified number of records from the database, then have arrow
buttons to display next or previous records. The problem is, I don't know
where to start, and once I get the datagrid set up, how do I only get the
specified records from SQL 2000?
Any help is greatly appreciated,
Greg
Paging Concept Using Vb
Hi,
This is Shariq, I doing SLA [Service level Agreement] using visual Basic
and back end MySql. I want to display large number of Items into the
grid and every time user have to scroll down the grid [ScGrid]. But I
want to make it simple by applying Paging concept, it means on refresh I
will display 1 to 10 records and when the user click the next button it
should display 11 to 20 records and so on, like how we are using the
yahoo mail box.
Can someone point me to some examples or samples?
Any help on this would be greatly appreciated
Thanks in advance
Md Shariq
Paging In Msflexgrid
please help in doing paging for the flexgrid
ie it should work like comand button is pressed
it should display 20 records at a time
thank u
KOTI.
Paging For Msflexgrid
please help in doing paging for the flexgrid
ie it should work like comand button is pressed
it should display 20 records at a time
thank u
Recordset Paging
Hi all!
I make a search program (with ADO) and do some recordset paging stuff to display the result. I use rs.PageSize, rs.PageCount, and rs.AbsolutePage to make it work. Everything`s ok, but then I don`t know how to make 'simple' information like:
record 1 - 10 of 200 in the first page and
record 11 - 20 of 200 in the second page etc (assuming the rs.PageSize = 10).
Would anyone like to show me the 'formula' to do the calculation here?
Thank you so very much! Regards.
Recordset Paging
Hi All,
I am trying to do record set paging in vb, but it is not working. What can be the reason?
The parameters which I am using is
recordset.CacheSize = 10000
recordset.CursorType = adOpenStatic
recordset.PageSize = 2
recordset.CursorLocation = adUseClient
recordset.AbsolutePage= 1
Please help me !
Thanx in advance
Jagat
Vb6 ADO Recordset Paging. Can Someone Help ?
I am in utter need of a simple VB6 recorset paging code snippet. I am obviously trying to page through records in my Access database and am having issues. Someone told me I should use the bookmark method or the ADODB.Recordset others say not to. I am clue less. A sample .zip file would help tremendously.
Thanks in advance,
Coolpeep
VsFlexGrid Paging Through Recordset
the application i'm working on has about 30,000 records. my grids datasource is an ADO recordset with all of the records 30,000 or whatever. here's the code i use:
Code:
Set fg.DataSource = myRS
'this populates the entire grid though with all 30,000 records!!
'not what want
what i wish to do though is only show like 250 records in the grid at one time and have a forward and back button to show the previous and next 250.
Also, i want to change a rows color based on text that is in a specific cell.
so basically when the grid is populated if a cell in a row has a certain text string i specifiy, then the entire row needs to be a certain color. is this unheard of?
i really need help getting that working!
if someone could post some example code that would achieve this i'm very greatful. this is the only part of my application that i'm lacking : (
any help is greatly appreciated!
Thanks!
Paging Through A Hierarchical Recordset
I am working with a 3 band hierarchical record set that could potentially return a massive amount of records but for 90% of the cases it would return a reasonable amount. I found this artical at msdn:
http://msdn.microsoft.com/library/de...ml/ivb0184.asp
which talks about setting up pages through large data sets. The only problem is that the code does not seem to work for hierarchical data. I get a run-time error '3001' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another error when using the code. The error occures then I try to append the fields which represent bands 2 and 3 from my large record set to a new sub record set of a given page size.
If anyone has any idea how to page through a hierarchical recordset using a mshflexgrid please offer me some advice.
Kaniada
Creating A Sms And Paging Program
Quote:
Originally posted by ariel_au
i am thinking of doing a program that can allow user to send message via internet and is received by a moblie phone or a pager.
anyone can give me any ideas or tips on how can i find codes and resources to do this program?
WEll, only place i know you can get that kinda stuff is probably through your phone company...but who's gonna give u code? that would be a cool idea tho, i'd definately use one to msg my friends cell phones...
Paging Backward In A Report
I am creating a report preview in a picture box. The report display records from an ADO recordset. It is a multple-page report with buttons for advancing through the pages. The next page ">" button is working and displays the next page when clicked.
Now I need to do the Previous page button "<". What is the best way to display the previous page? Do to the way the report prints, I cannot read backwards x records. I think that I will either have to insert a page number or some other value in the recordset or else store some values in arrays. In order to create a given page there are 2 pieces of information which are necessary. Can I read a specific record in the recordset with a key value? Has anybody done a backward report page function?
Robert
Creating A Sms And Paging Program
i am thinking of doing a program that can allow user to send message via internet and is received by a moblie phone or a pager.
anyone can give me any ideas or tips on how can i find codes and resources to do this program?
ADO Recordset Paging Problem!
I'm using SQL server 7.0 for managing my database. I have an event log table that has atleast 1.5 million entries. I use the paging schema to speed up the data retrieval and display on my VB client. The paging schema I'm following is posted on this site by a senior member. A sample code is given below for reference:
Set mobjRecordsetEventLog = New ADODB.Recordset
mobjRecordsetEventLog.CursorLocation = adUseClient
mobjRecordsetEventLog.PageSize = 10
mobjRecordsetEventLog.CacheSize = 10
mobjRecordsetEventLog.Open mstrSQLFilter, mobjEventViewer, adOpenStatic, adLockReadOnly, adAsyncFetch
Where mstrSQLFilter stores the query that needs to be executed. It is a select query that refers the EventLog table that has around 1.5 million records.
mobjEventViewer is the ADO connection object.
Now the problem is that I always get a "Timeout expired" error at the mobjRecordsetEventLog.Open statement. The process ends abruptly and my grid remains blank.
Can anyone pointout where I might be wrong.
Paging Through Returned Search ASP Pages
Hi Guys
Ive written an asp page that searches a caterogy of music genre on my access database.
When the results are returned , Artist Title, Comments etc, I would like to be able to page through the results.
I have iincluded the code for one of my query pages.
It works, but must have an error in it, and I cannot for the life of me, figure it out.
It should display all records up to 5 per page, and add next and previous links at the bottom of the page, if more than 5 records have been found, and in the case I am testing I know it should return 10 records!
The strange thing is lets say I successfully query 10 records.
Only 5 are returned, however their is no next button?
I change the constant iPageSize=5 to iPageSize=6 or 7 or 8, and it is the same.
However if I change iPageSize=5 to iPageSize=4 it still displays the 5 records from the first page, only now it has a next button that takes me to a second page with one record on, a duplicate of the last record from the first page!
Also if I change iPageSize=5 to iPageSize=3 it still displays the 5 records from the first page, again it has a next button that takes me to a second page with one record on, this time a duplicate of the last two records from the first page!
I am absolutely confused.
I am looking at the loop, but I cant see any errors, as it all views fine.
Please can some one have a look at this code.
CODE
-----------------------
<!--#include File="adovbs.inc"-->
<%
dim conn
dim rs
dim strconn
dim sql
dim searchTerm
Const iPageSize=5'How many records To show
Dim CPage'Current Page No.
Dim TotPage'Total No. of pages if iPageSize records are displayed per page.
Dim i'Counter
'Paging
CPage=Cint(Request.Form("CurrentPage"))'get CPage value from form's CurrentPage field
Select Case Request.Form("Submit")
Case "Previous" 'if prev button pressed
CPage = Cint(CPage) - 1 'decrease current page
Case "Next" 'if next button pressed
CPage = Cint(CPage) + 1 'increase page count
End Select
'set a local variable to my DSN-less connection String
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("recordsnorthwest.mdb")
'Create the Connection object
set conn = server.createobject("adodb.connection")
conn.open strconn
searchTerm="Old Skool"
'Create the recordset object
set rs = server.createobject("adodb.recordset")
sql="SELECT * FROM stock WHERE Category LIKE '%"&searchTerm&"%'"
rs.open sql, conn, 3
'paging
Rs.PageSize=iPageSize
if CPage=0 Then CPage=1'initially make current page = first page
if Not(Rs.EOF) Then Rs.AbsolutePage=CPage'specifies that current record resides In CPage
TotPage=Rs.PageCount'stores total no. of pages
%>
<head><title>Search For Old Skool</title>
<link href="css/main.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align=center><img src="images/recordsnorthwest_logo.jpg" width="422" height="34"></div>
<h2>Old Skool Search</h2>
<table border="1" >
<tr>
<th>Picture </th>
<th>Artist </th>
<th>Title </th>
<th>Label </th>
<th>Comment </th>
<th>Year Made </th>
<th>Price </th>
<th>Mp3 </th>
</tr>
<%
For i=1 To Rs.PageSize
DO Until RS.EOF
%>
<tr align="center">
<td><img src="<%=RS("Picture")%>"></td>
<td> <%=RS("Artist")%> </td>
<td> <%=RS("Title")%> </td>
<td> <%=RS("Label")%> </td>
<td> <%=RS("Comment")%> </td>
<td> <%=RS("YearMade")%> </td>
<td> <%=RS("Price")%> </td>
<td><a href="<%=RS("Mp3")%>"><img src=images/mp3_button.gif border=0></a></td>
</tr>
<%
Rs.MoveNext
loop
%>
<%
if Rs.EOF Then Exit For
Next
'close all connections and recordsets
Rs.Close
Conn.Close
Set Rs = Nothing
Set Conn = Nothing
%>
</table>
<br>
<!-- ***************************** FINISH *************************** -->
<!-- Link to go back to the start page. -->
<br><br><br>
<a href="default.asp">Cancel</a> back to menu
<br><br>
Page <%=CPage %> of <%=TotPage %><P>
<!--'store current page value In hidden Type and display next-prev buttons-->
<FORM Action="<%=Request.ServerVariables("SCRIPT_NAME") %>" Method=POST>
<INPUT Type=Hidden name="CurrentPage" Value="<%=CPage%>" >
<% if CPage > 1 Then %>
<INPUT type=Submit Name="Submit" Value="Previous">
<% End if%>
<% if CPage <> TotPage Then %>
<INPUT type=Submit Name="Submit" Value="Next">
<% End if %>
</FORM>
</body>
</html>
Invalid Property Value.. Paging Database
I take from database development FAQ in the forum, and I use it on my form.
I don't know what wrong, can anyone pls help? thanks in advance
My problem when it run is this:
run time error
invalid property value
Code:
Option Explicit
'the number of records to show per page
'(note that there are only 31 records in the database table)
Const intRecordsPerPage As Integer = 5
'the page we are currently showing
Private intPage As Integer
'Private objCn As ADODB.Connection
'Private objRs As ADODB.Recordset
'the total number of pages
Private intPageCount As Integer
Dim con_Data As New ADODB.Connection
Dim Rs As New ADODB.Recordset
Private Sub ShowPage()
'shows a "page" of records
Dim intRecord As Integer
Dim lvwItem As ListItem
'move to the appropriate page of the recordset
Rs.AbsolutePage = intPage
'clear the control
lvwRSPageDemo.ListItems.Clear
'The For loop will display just the number of records we specified
For intRecord = 1 To Rs.PageSize
'add the data to the control
'(change these lines to suit your fields, and the control you are using)
Set lvwItem = lvwRSPageDemo.ListItems.Add(, , Rs.Fields.Item("productid").Value)
lvwItem.SubItems(1) = Rs.Fields.Item("productname").Value
lvwItem.SubItems(2) = Rs.Fields.Item("unit").Value
lvwItem.SubItems(3) = Rs.Fields.Item("partnumber").Value
lvwItem.SubItems(4) = Rs.Fields.Item("brand").Value
'move to the next record within this page
Rs.MoveNext
'if we have run out of records (which we may on the last page) exit the loop
If Rs.EOF Then Exit For
Next intRecord
'show the page number
lblPageInfo.Caption = "Page " & intPage & " of " & intPageCount
'enable/disable buttons as apt
cmdPrev.Enabled = (intPage > 1)
cmdFirst.Enabled = (intPage > 1)
cmdNext.Enabled = (intPage < intPageCount)
cmdLast.Enabled = (intPage < intPageCount)
End Sub
Private Sub SearchId_Click()
'set everything up
Dim strSQL As String
'connect to the database
' Set objCn = New ADODB.Connection
' objCn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "
ecordsetpaging.mdb;" & _
"Persist Security Info=False"
' objCn.Open
'set up the recordset (but we dont fill it until after setting paging info)
' Set objRs = New ADODB.Recordset
strSQL = "SELECT * " _
& "FROM product " _
& "ORDER BY productid "
' strSQL = "SELECT FName, LName, DOB, EmpNumb, DOH " _
& "FROM tblemployeeinfo " _
& "ORDER BY LName "
'to ensure we get a RecordCount for our label, set the cursor location to Client
Rs.CursorLocation = adUseClient
'set up the paging.
'the page size specifies how many records are on each page
Rs.PageSize = intRecordsPerPage
'the cache size specifies how many records should be stored in memory
'If Cachesize and PageSize are equal (as they are here) then only
'the records to be displayed will be cached in the recordset
Rs.CacheSize = intRecordsPerPage
'open the recordset - as there is no WHERE clause on the query, all 31 records
'in the included example db table will be captured in the recordset.
Rs.Open strSQL, con_Data, adOpenStatic, adLockReadOnly
lblRecordCount.Caption = Rs.RecordCount & " records are contained in the recordset."
'PageCount simply tells us how many pages there are in our recordset object
intPageCount = Rs.PageCount
'show the data
intPage = 1
Call ShowPage
Call HflexGrid
End Sub
ALPHA-NUMERIC PAGING PROGRAM
Hey All,
I would like to create a Visual Basic program that would allow me to send alpha-numeric pages to a pager without having to use a modem. We are currently using a free program that uses SNPP, but I would like to create my own app. so that I could add some additional features that the current software does not offer. I've searched this site on the topic, but all I could find were some forums in the Perl section. I was hoping that there would be something out there similar to the sendmail.dll. If anyone knows how I could accomplish this in Visual Basic could you please help me out or point me in the right direction? Thanks!
Nick
Datagrid Or Msflexgrid Paging In Visual Basic ???
I would like to implement procedures to create a datagrid looks like .Net datagrid but in visual basic with paging ... it's possible ??
if it's What control is better to do it (Msflexgrid or datagrid) ? Any idea?
Datareport
My biiiiig problem is if I use DataEnvironment1 in my application and connect whit DataReport, everything work fine on my PC. But when I tray to install my program on other PC, I got error message when I tray to execute this DataReport. Error message is "Failed getting rowset from current data source" Help!! What I need to install to!
Datareport Without DB
Hi all, im having a bit of a problem at the moment. I have this code in a mod
Code:
Public Type HistoryDetails
HistoryDate As String
HistoryTime As String
HistoryType As String
HistoryRegards As String
End Type
Global HistoryLog() As HistoryDetails
My program runs and HistoryLog() gets ReDimmed and data added to it so that I have a lot of data in it. e.g.
HistoryLog(1).HistoryDate = 27/01/2004
HistoryLog(1).HistoryTime = 00:00
HistoryLog(1).HistoryType = Action
HistoryLog(1).HistoryRegards = Going to sleep
Now what I want to do is display the entire contents of HistoryLog into a DataReport.
Any ideas???
Thanks,
Lucas
DataReport
I need to insert a memo field into a datarepost.But i am no able to do it. Anyone can help me?
Help On Datareport
I need to make a datareport that supports legal format (8.5 X 14) instead of the usual letter (8.5 X 11). How can I do this? Can anybody help me out here?
I need that the information in the group header of a data report be on the page header, the problem is that the information in the group header are fields from a table and in the page header does not accept these type of information, anybody has an alternate way to do this? I need that info to be the pageheader.
my e-mail is siu@furiaverde.com
Datareport, Is This Possible?
On my datareport, I have a unbound field.
On that unbound field I am trying to add something like this:
.Controls.Item("txtDoseage").DataField = "MEDDOSE" '& " mgs"
is that possible? if not how could I do something like this.
textbox field sits in the detail section
Thanks
he9ap00
Can Any One Help Me With VB Datareport
hi!
i am using vb 6 and and ms access 2000.
i am having some problems using the data report.
i have created a data environment. and i am also having problem giving the command text
if i write a simple select query such as
select * from test
i get an error
[Microsoft][Microsoft ODBC access driver ] Syntax error in from clause
help!
x11
Datareport
Hello,
I am trying to number the records on a Datareport and was wondering if anyone knew how to do it?
I have a Label with the date in it, the caption for this is '%d'. Is there a similar way to this to number the records?
Also, is there a way to display the total number of records at the end of the report??
Cheers in advance for any help,
John
DataReport
I am in my beggining in VB. My problem is that I failed to have a datareport with only the information I need. I have always the whole records in the datareport. Why VB don't take into consideration my selection.
Think you for helping me.
Need Help On DataReport
I have a VB application that displays information of a person in the organization. Now, I am trying to create a VB DataReport that prints out a person's information being displayed on the application. The parameter for the select statement of the report is PERSON_ID (primary key).
Apparently, I cannot define the select statement in the design time since the PERSON_ID wil dynamically change according to the record that I am trying to display. Could you anyone shred me some lights on how to implement this report in the run time? Any source code or sample code will be extremely helpful. Hundred thanks for your help!
Have a good day!
-MH
VB Datareport
hello sir
pblm in VB-datareport
i am developing an invoice/ biiling software.
i am displaying a report of particular invoice with its respective details.
now in mine report i am showing all the inv. detail like Sr. No., itm_desc, Qty, rate, amt in detail section of datareport.
with a box(rectangual shape) surrounding it, that is also drawn in detail section.
now my pblm is that i want to display that shape as per the requirement, that is i want to set a fixed box size.
but in my report box size is changing as the no. of records are added or decreased. ie i want to set a preprinted format within dataeport itself.
pblm in detail:
if for a particular inv. i am having three items (records) in detail section then it is showing me the size of box of three records only, if there r two record then the box size is adjusted or changed to two records.
but i want to have fixed box size which will be displayed on full paper size , and within that i want to show my detail records.
i tried so many option within datareport itself, like increasing box size, drawing boxes or line even on page header section cntd. till page footer section, but it didn't work
pls help me out, i am really in urgent need of this help
pls provide me with code and detailed explanation .
thank you
regars
poonam jadhav
DataReport
Is there any way to embed a dataReport into a form? What I would like is a form where I can pick dates up the top, and then it will show the datareport below on the same form. Hmmm...is this possible?
DataReport In VB6.0
Here is the problem..Can a Datareport be prgrammed from code..Example....
I know you can do adodb recordsets.But Heres what I was wondering....
When you create a Data Report,you add your fields ..i.e labels(unbound) and text boxes(bound to a field) .When you do a label you write what you want to Title .....
I wonder if and how to do it in code...if you leave a label blank and when you show your report changes its caption........can this be done??????How
DataReport
Any one konws how to connection report with data base??
I working with data1.
ty,Sasi
|