Simple database question

Dim Recordset As ADODB.Recordset
Set Recordset = New ADODB.Recordset

Recordset.Fields.Append "Number", adInteger
Recordset.Open

Recordset.AddNew
Recordset("Getal").Value = 1
Recordset.AddNew
Recordset("Getal").Value = 3

Recordset.Update

Question:
How can I insert a record with value "2" BETWEEN "1" and "3"?
If I use .AddNew, the new record is placed AFTER 3!

Thanks very much in advance for any help / examples!

Comments

  • : Dim Recordset As ADODB.Recordset
    : Set Recordset = New ADODB.Recordset
    :
    : Recordset.Fields.Append "Number", adInteger
    : Recordset.Open
    :
    : Recordset.AddNew
    : Recordset("Getal").Value = 1
    : Recordset.AddNew
    : Recordset("Getal").Value = 3
    :
    : Recordset.Update
    :
    : Question:
    : How can I insert a record with value "2" BETWEEN "1" and "3"?
    : If I use .AddNew, the new record is placed AFTER 3!

    Do the .AddNew and then use the .Sort method


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • It shouldn't matter, because you end up writing SQL queries that are ordered the way you want, even if you insert them out of order.

    : Dim Recordset As ADODB.Recordset
    : Set Recordset = New ADODB.Recordset
    :
    : Recordset.Fields.Append "Number", adInteger
    : Recordset.Open
    :
    : Recordset.AddNew
    : Recordset("Getal").Value = 1
    : Recordset.AddNew
    : Recordset("Getal").Value = 3
    :
    : Recordset.Update
    :
    : Question:
    : How can I insert a record with value "2" BETWEEN "1" and "3"?
    : If I use .AddNew, the new record is placed AFTER 3!
    :
    : Thanks very much in advance for any help / examples!
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories