Avatar billede hadaps Nybegynder
05. november 2002 - 15:35 Der er 5 kommentarer og
1 løsning

flytte til sidste record

Hvor dan kan man rykke ned til sidste record i tabellen?

når jeg bruger rs.movelas kommer den med denne fejl:

Microsoft OLE DB Provider for ODBC Drivers error '80040e24'

Rowset does not support fetching backward.
Avatar billede medions Nybegynder
05. november 2002 - 15:39 #1
gør sådan her i stedet for:

strSQL = "SELECT * FROM tabel ORDER BY [ID] ASC"
Set objRs = objConn.Execute(strSQL)

Response.Write(objRs("ID"))

så får du oxo den sidste Record!

//>Rune
Avatar billede medions Nybegynder
05. november 2002 - 15:39 #2
ID <- skal jo selvfølgelig være autonumnering!

//>Rune
Avatar billede hadaps Nybegynder
05. november 2002 - 15:41 #3
aha - havde ikke lige tænkt den vej ;)

men har du en forklering på HVORFOR jeg ikke kan bruge movelast, når jeg godt kan brige move 2
Avatar billede medions Nybegynder
05. november 2002 - 15:44 #4
Move to the first, last, next, or previous record in a specified Recordset object and make that record the current record.

Syntax

recordset.{MoveFirst | MoveLast [dbRunAsync] | MoveNext | MovePrevious}

The recordset placeholder is an object variable that represents an open Recordset object.

Remarks

Use the Move methods to move from record to record without applying a condition.

Caution If you edit the current record, be sure you use the Update method to save the changes before you move to another record. If you move to another record without updating, your changes are lost without warning.

When you open a Recordset, the first record is current and the BOF property is False. If the Recordset contains no records, the BOF property is True, and there is no current record.

If the first or last record is already current when you use MoveFirst or MoveLast, the current record doesn't change.

If you use MovePrevious when the first record is current, the BOF property is True, and there is no current record. If you use MovePrevious again, an error occurs, and BOF remains True.

If you use MoveNext when the last record is current, the EOF property is True, and there is no current record. If you use MoveNext again, an error occurs, and EOF remains True.

If recordset refers to a table-type Recordset (Microsoft Jet workspaces only), movement follows the current index. You can set the current index by using the Index property. If you don't set the current index, the order of returned records is undefined.

Important  You can use the MoveLast method to fully populate a dynaset- or snapshot-type Recordset to provide the current number of records in the Recordset. However, if you use MoveLast in this way, you can slow down your application's performance. You should only use MoveLast to get a record count if it is absolutely necessary to obtain an accurate record count on a newly opened Recordset. If you use the dbRunAsync constant with MoveLast, the method call is asynchronous. You can use the StillExecuting property to determine when the Recordset is fully populated, and you can use the Cancel method to terminate execution of the asynchronous MoveLast method call.

You can't use the MoveFirst, MoveLast, and MovePrevious methods on a forward-only&#8211;type Recordset object.

To move the position of the current record in a Recordset object a specific number of records forward or backward, use the Move method.

//>Rune
Avatar billede hadaps Nybegynder
05. november 2002 - 16:04 #5
takker
Avatar billede medions Nybegynder
05. november 2002 - 16:08 #6
Anytime ;o)
Thx 4 Poinz

//>Rune
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester