SQL and Autonumber fields

Discussion in 'ASP General' started by Ian Griffiths, Nov 6, 2003.

  1. Right, so I'm creating a basic ASP guest book, keeping my guest book entries
    in a Microsoft Access database, and using ADO to access it. My problem is
    that I am using the autonumbered ID field to split my guestbook into pages
    of 10 entries. It works for the most part, but if I delete an entry, a gap
    is left in the records and I end up 9 entries instead of 10 on that page.

    Basically I need a better way of sorting this out - I thought of SELECTing
    all the records into an array first and then working from that, but I can't
    get array to be dynamic enough in VBscript. Any ideas?

    Cheers,

    Ian G.
    Ian Griffiths, Nov 6, 2003
    #1
    1. Advertising

  2. www.aspfaq.com/2120



    "Ian Griffiths" <> wrote in message
    news:boejok$hnl$...
    > Right, so I'm creating a basic ASP guest book, keeping my guest book

    entries
    > in a Microsoft Access database, and using ADO to access it. My problem is
    > that I am using the autonumbered ID field to split my guestbook into pages
    > of 10 entries. It works for the most part, but if I delete an entry, a gap
    > is left in the records and I end up 9 entries instead of 10 on that page.
    >
    > Basically I need a better way of sorting this out - I thought of SELECTing
    > all the records into an array first and then working from that, but I

    can't
    > get array to be dynamic enough in VBscript. Any ideas?
    >
    > Cheers,
    >
    > Ian G.
    >
    >
    Aaron Bertrand - MVP, Nov 6, 2003
    #2
    1. Advertising

  3. "Aaron Bertrand - MVP" <> wrote in message
    news:...
    > www.aspfaq.com/2120
    >
    >
    >
    > "Ian Griffiths" <> wrote in message
    > news:boejok$hnl$...
    > > Right, so I'm creating a basic ASP guest book, keeping my guest book

    > entries
    > > in a Microsoft Access database, and using ADO to access it. My

    problem is
    > > that I am using the autonumbered ID field to split my guestbook into

    pages
    > > of 10 entries. It works for the most part, but if I delete an entry,

    a gap
    > > is left in the records and I end up 9 entries instead of 10 on that

    page.
    > >
    > > Basically I need a better way of sorting this out - I thought of

    SELECTing
    > > all the records into an array first and then working from that, but

    I
    > can't
    > > get array to be dynamic enough in VBscript. Any ideas?
    > >
    > > Cheers,
    > >
    > > Ian G.


    Here's a slightly OT question. When referencing articles at ASPFAQ,
    should we abbreviate like you did above? On the one hand abbreviated
    links reduce overall traffic on the network, on the other, they require
    additional processing by your server. Inquiring minds want to know.

    -Chris Hohmann
    Chris Hohmann, Nov 7, 2003
    #3
  4. > Here's a slightly OT question. When referencing articles at ASPFAQ,
    > should we abbreviate like you did above? On the one hand abbreviated
    > links reduce overall traffic on the network, on the other, they require
    > additional processing by your server. Inquiring minds want to know.


    Heh, great question. :)

    I'm not really concerned about network traffic (let's count; show.asp?id=
    .... hmmm, that's 12 bytes * how many news servers), and certainly those
    extra 12 bytes

    The processing on the server isn't all that heavy; hits a custom page that
    determines from cache whether the id is valid; if so, redirects. If not,
    sends to default.asp.

    Aside from the fact that it looks tidier, using the short format will allow
    me to change page names, or even extensions, without having to keep old
    legacy show.asp around permanently. Though it looks like that will be
    impossible, if you so a search on google groups for www.aspfaq.com/show.asp
    :)

    Ideally, all the links would be the short format, but since there are way
    too many of the longer format out there, I don't think it matters either
    way.

    A
    Aaron Bertrand - MVP, Nov 7, 2003
    #4
  5. Ian Griffiths

    Ray at Guest

    "Aaron Bertrand - MVP" <> wrote in message
    news:%...

    > Aside from the fact that it looks tidier, using the short format will

    allow
    > me to change page names, or even extensions, without having to keep old
    > legacy show.asp around permanently. Though it looks like that will be
    > impossible, if you so a search on google groups for

    www.aspfaq.com/show.asp
    > :)
    >


    You could create a custom 404 page that would specifically handle request
    for show.asp and then redirect accordingly. If you'd like to learn how to
    make a custom 404 page, see here. http://www.aspfaq.com/show.asp?id=2162
    :p

    Ray at work
    Ray at, Nov 7, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hai Nguyen
    Replies:
    3
    Views:
    1,499
    Hai Nguyen
    Jan 10, 2004
  2. nicholas
    Replies:
    4
    Views:
    11,280
  3. loreille
    Replies:
    1
    Views:
    4,454
    Ben Strackany
    Oct 28, 2004
  4. loreille
    Replies:
    0
    Views:
    448
    loreille
    Oct 28, 2004
  5. Neil Barnwell

    Autonumber fields in JDBC

    Neil Barnwell, Jul 4, 2004, in forum: Java
    Replies:
    5
    Views:
    5,812
Loading...

Share This Page