holding a connection object across several ASP pages

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default holding a connection object across several ASP pages

    Hi. I am new to ASP. I need to create a "wizard" using a SQL 7
    database that will display a few forms and collect data from the user.
    My initial thought to handle this is to build my connection on the
    first page and begin a transaction. As the user progresses through
    the different screens, I would insert the data and finally commit the
    data on the last page. The user will always have a cancel button
    available to them for the rollback. However, with this method, the
    connection object would have to be available to all the pages. With
    the little ASP experience I have, I've found that all objects created
    in a page is only available to that one page. Is it possible to have
    my connection object available for all the necessary pages? This is
    just my first crack at this, so if anyone can think of a better way to
    do this, that would be appreciated also. Thanks for all the help.

    Mike
    Michael Bosco Guest

  2. Similar Questions and Discussions

    1. User Connection Settings Not Holding
      When I send a connection key to a user of Contribute 4, the user is getting the following error when trying to implement the connection key: Your...
    2. Database Connection Object
      1. Check out the microsoft application blocks - data access - http://support.microsoft.com/default.aspx?scid=kb;en-us;829028 2. Check out the...
    3. Unable to resize object in proportion by holding shift key
      When selecting an object (text or otherwise) I have been able to constrain proportion by holding down shift while draging the object larger/smaller....
    4. Connection object
      I have inherited the following code from an existing system login asp page in my company. I am connecting to the same database and have been told to...
    5. Holding a reference to a ruby object outside the interpreter
      How can I hold a reference to a ruby object outside the interpreter? Ie, how can I prevent it from being garbage collected if my (external)...
  3. #2

    Default Re: holding a connection object across several ASP pages

    It is outstanding that you asked, because you could have wound up taking the
    wrong path. :]

    In my opinion, it is better that you just carry your data from page to page
    by some other means (cookies, session variables, hidden inputs on forms,
    querystring) and then on the final "committal" page, when the user submits,
    that is when you connect to your DB and insert the data.

    While it is possible to open a connection to a DB and carry it from page to
    page, it is <strong>strongly ill-advised</strong>. Also, if you did do this
    and your users cancelled, you'd have a bunch of meaningless, incomplete data
    in your database, well, except that you said you'd do it as a transaction,
    so I guess you're thinking you'd roll back. My suggestion is to make one
    connection on the final page and don't touch the DB before that (unless you
    need to for other reasons of course).

    Ray at work

    "Michael Bosco" <mbosco51@si.rr.com> wrote in message
    news:2ccffbac.0401211431.6c920e26@posting.google.c om...
    > Hi. I am new to ASP. I need to create a "wizard" using a SQL 7
    > database that will display a few forms and collect data from the user.
    > My initial thought to handle this is to build my connection on the
    > first page and begin a transaction. As the user progresses through
    > the different screens, I would insert the data and finally commit the
    > data on the last page. The user will always have a cancel button
    > available to them for the rollback. However, with this method, the
    > connection object would have to be available to all the pages. With
    > the little ASP experience I have, I've found that all objects created
    > in a page is only available to that one page. Is it possible to have
    > my connection object available for all the necessary pages? This is
    > just my first crack at this, so if anyone can think of a better way to
    > do this, that would be appreciated also. Thanks for all the help.
    >
    > Mike

    Ray at Guest

  4. #3

    Default Re: holding a connection object across several ASP pages

    "Michael Bosco" <mbosco51@si.rr.com> wrote in message
    news:2ccffbac.0401211431.6c920e26@posting.google.c om...
    > Hi. I am new to ASP. I need to create a "wizard" using a SQL 7
    > database that will display a few forms and collect data from the user.
    > My initial thought to handle this is to build my connection on the
    > first page and begin a transaction. As the user progresses through
    > the different screens, I would insert the data and finally commit the
    > data on the last page. The user will always have a cancel button
    > available to them for the rollback. However, with this method, the
    > connection object would have to be available to all the pages. With
    > the little ASP experience I have, I've found that all objects created
    > in a page is only available to that one page. Is it possible to have
    > my connection object available for all the necessary pages? This is
    > just my first crack at this, so if anyone can think of a better way to
    > do this, that would be appreciated also. Thanks for all the help.
    Bad idea ...
    [url]http://www.aspfaq.com/show.asp?id=2053[/url]

    --
    Tom Kaminski IIS MVP
    [url]http://www.iistoolshed.com/[/url] - tools, scripts, and utilities for running IIS
    [url]http://mvp.support.microsoft.com/[/url]
    [url]http://www.microsoft.com/windowsserver2003/community/centers/iis/[/url]



    Tom Kaminski [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139