Counting the number of downloads

Discussion in 'ASP General' started by Luc Dal, Jun 3, 2005.

  1. Luc Dal

    Luc Dal Guest

    Hello

    On a site, I've documents that can be downloaded.
    To fill the html page, I read a table in an access database and I write my
    code
    Each document has a title, an url, an id and a variable "counter"
    How can I increment the counter (in the database) and open the docuemnt in
    the same operation ???
    Thanks for your assistance
    Luc
     
    Luc Dal, Jun 3, 2005
    #1
    1. Advertising

  2. Luc Dal wrote:
    > Hello
    >
    > On a site, I've documents that can be downloaded.
    > To fill the html page, I read a table in an access database and I
    > write my code
    > Each document has a title, an url, an id and a variable "counter"
    > How can I increment the counter (in the database) and open the
    > docuemnt in the same operation ???
    > Thanks for your assistance
    > Luc


    You can't. You will need two queries: one to perform the increment, and the
    other to retrieve the data.

    With SQL Server, you could use a stored procedure.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jun 3, 2005
    #2
    1. Advertising

  3. Luc Dal

    Patrice Guest

    Not sure what you meant but my understanding is that the problem might be
    that you are using direct links to your documents making uneasy to handle
    the download process (as IIS handles this for you and no code is
    trigerred)...

    Another approach would be to create links to an ASP download page. This page
    would then "stream" the file to the browser and would update the counter (as
    you'll have now your won code triggered when the user starts the download).

    Try :
    http://support.microsoft.com/kb/260519/en-us (for raising the download
    dialog client side)
    http://support.microsoft.com/kb/276488/en-us (for streaming the file)

    Addtionaly it allows to put the files outside of the web site and to perform
    whatever checks you might want before letting the use download the file...

    --

    Patrice

    --

    "Luc Dal" <> a écrit dans le message de
    news:d7pbuo$rbc$...
    > Hello
    >
    > On a site, I've documents that can be downloaded.
    > To fill the html page, I read a table in an access database and I write my
    > code
    > Each document has a title, an url, an id and a variable "counter"
    > How can I increment the counter (in the database) and open the docuemnt in
    > the same operation ???
    > Thanks for your assistance
    > Luc
    >
    >
     
    Patrice, Jun 3, 2005
    #3
    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. Darren
    Replies:
    0
    Views:
    295
    Darren
    Jan 26, 2004
  2. Manu Mahendru
    Replies:
    5
    Views:
    1,028
    Oliver Wong
    Jan 10, 2006
  3. Lizard
    Replies:
    3
    Views:
    4,480
    Lizard
    Oct 7, 2003
  4. edwardfredriks

    counting up instead of counting down

    edwardfredriks, Sep 6, 2005, in forum: Javascript
    Replies:
    6
    Views:
    241
    Dr John Stockton
    Sep 7, 2005
  5. Replies:
    1
    Views:
    100
    Robert Kern
    Jul 22, 2013
Loading...

Share This Page