Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Paging kroz RecordSet

[es] :: Visual Basic 6 :: Paging kroz RecordSet

[ Pregleda: 5772 | Odgovora: 6 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

impact
Vladimir Golušin
Kikinda

Član broj: 2517
Poruke: 112
212.200.76.*



Profil

icon Paging kroz RecordSet08.04.2002. u 00:41 - pre 267 meseci
Da li neko ima resenje za izlistavanje rezultata iz baze po stranicama?
Npr 10 rezultata po jednoj stranici!
 
Odgovor na temu

jc denton

Član broj: 2358
Poruke: 1705
*.tehnicom.net



Profil

icon Re: Paging kroz RecordSet08.04.2002. u 00:42 - pre 267 meseci
Imam ja, ali u php-u. Mislim da bi lako preradio za VB.
fire, walk with me
 
Odgovor na temu

impact
Vladimir Golušin
Kikinda

Član broj: 2517
Poruke: 112
212.200.76.*



Profil

icon Re: Paging kroz RecordSet08.04.2002. u 00:56 - pre 267 meseci
Citat:
Mislim da bi lako preradio za VB.


Ajde ako ti ne predstavlja problem!
 
Odgovor na temu

jc denton

Član broj: 2358
Poruke: 1705
*.tehnicom.net



Profil

icon Re: Paging kroz RecordSet08.04.2002. u 01:03 - pre 267 meseci
Uz poruku je php skript koji odradjuje nesto slicno kao Google. Nadam se da ti nece biti tesko da prebacis na VB.

pozdrav
fire, walk with me
Prikačeni fajlovi
 
Odgovor na temu

jc denton

Član broj: 2358
Poruke: 1705
*.tehnicom.net



Profil

icon Re: Paging kroz RecordSet08.04.2002. u 01:39 - pre 267 meseci
Ima jos jedna fina stvar, bar u MySQL-u :

SELECT * FROM TABELA LIMIT m,n

citiram iz MySQL manual-a :

* The `LIMIT' clause can be used to constrain the number of rows
returned by the `SELECT' statement. `LIMIT' takes one or two
numeric arguments.

If two arguments are given, the first specifies the offset of the
first row to return, the second specifies the maximum number of
rows to return. The offset of the initial row is 0 (not 1):

mysql> select * from table LIMIT 5,10; # Retrieve rows 6-15

If one argument is given, it indicates the maximum number of rows
to return:

mysql> select * from table LIMIT 5; # Retrieve first 5 rows

In other words, `LIMIT n' is equivalent to `LIMIT 0,n'.
* The `LIMIT' clause can be used to constrain the number of rows
returned by the `SELECT' statement. `LIMIT' takes one or two
numeric arguments.

If two arguments are given, the first specifies the offset of the
first row to return, the second specifies the maximum number of
rows to return. The offset of the initial row is 0 (not 1):

mysql> select * from table LIMIT 5,10; # Retrieve rows 6-15

If one argument is given, it indicates the maximum number of rows
to return:

mysql> select * from table LIMIT 5; # Retrieve first 5 rows

In other words, `LIMIT n' is equivalent to `LIMIT 0,n'.

fire, walk with me
 
Odgovor na temu

impact
Vladimir Golušin
Kikinda

Član broj: 2517
Poruke: 112
212.200.76.*



Profil

icon Re: Paging kroz RecordSet08.04.2002. u 01:40 - pre 267 meseci
Citat:
jc denton: Nadam se da ti nece biti tesko da prebacis na VB.


Pa ne znam PHP, ali probaću. Ukoliko budem imao problema, staviću post na forum.
 
Odgovor na temu

Rodd
Rodoljub Petrović
web developer, Extreme
Beograd

Član broj: 242
Poruke: 358
*.absolutok.net

ICQ: 114756071
Sajt: www.rodpetrovic.com


Profil

icon Re: Paging kroz RecordSet14.04.2002. u 01:09 - pre 267 meseci
Objekat ADODB.Recordset već ima ugrađen paging u sebe, koji je besmisleno lak za korišćenje: Pravac ovde.

Inače ako je baza sa kojom radiš SQL Server, za paging možeš da koristiš i storniranu proceduru, što je mnogo efikasnije. Evo primera koji sam ja uradio skoro:

Code:

CREATE PROCEDURE sp_Stranice
 (
  @Page int,
  @RecsPerPage int,
  @SQLString nvarchar(4000)
 )
AS
 
SET NOCOUNT ON
 
CREATE TABLE #TempItems
(
 ID int IDENTITY,
 ProdavnicaID int,
 TrzniCentar nvarchar(50),
 Prodavnica nvarchar(50),
 Opis nvarchar(255),
 DelatnostID int,
 TCID int,
 KR nvarchar(4000)
)
 
INSERT INTO #TempItems (ProdavnicaID,TrzniCentar,Prodavnica,Opis,DelatnostID,TCID, KR)
EXEC(@SQLString)
 
DECLARE @FirstRec int, @LastRec int
SELECT @FirstRec = (@Page - 1) * @RecsPerPage
SELECT @LastRec = (@Page * @RecsPerPage + 1)
 
SELECT *,
       MoreRecords = 
 (
  SELECT COUNT(*) 
  FROM #TempItems TI
  WHERE TI.ID >= @LastRec
 ) 
FROM #TempItems
WHERE ID > @FirstRec AND ID < @LastRec
 
SET NOCOUNT OFF
GO


Originalnu proceduru i sva pojašnjenja naći ćeš ovde.

Pozdrav.
 
Odgovor na temu

[es] :: Visual Basic 6 :: Paging kroz RecordSet

[ Pregleda: 5772 | Odgovora: 6 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.