Dear All

I have created a calendar asp page using vbScript that
loads data from a SQL database. It highlights the date I
have data. Everything works well, however I have one
question about the data access procedure and one about
erasing the array.

I load the data for the current month into an array after
opening a connection with the database and then close the
connection. If the user then selects the next month,
another connection is opened and the values loaded into an
array. Like above the connection is closed. Is this the
best way to approach it when I will have hundreds of users
accessing the SQL Server database at the same time?

Current Month >> Opens connection >> Fills Array >>
Displays results >> Closes Connection.
Next Month >> Opens connection >> Fills Array >> Displays
results >> Closes Connection.

If I create the connection to the database and fill the
array with data in the Header of the HTML page and display
the contents of the array in the Body of the page, where
do I erase the array, or do I even need to?

Thanks again and I appreciate your help.

Alastair MacFarlane

Re: Data Access Question by Bob

Bob
Wed Sep 17 07:51:37 CDT 2003

Alastair MacFarlane wrote:
> Dear All
>
> I have created a calendar asp page using vbScript that
> loads data from a SQL database. It highlights the date I
> have data. Everything works well, however I have one
> question about the data access procedure and one about
> erasing the array.
>
> I load the data for the current month into an array after
> opening a connection with the database and then close the
> connection. If the user then selects the next month,
> another connection is opened and the values loaded into an
> array. Like above the connection is closed. Is this the
> best way to approach it when I will have hundreds of users
> accessing the SQL Server database at the same time?

Yes. This allows connection pooling to be used which minimizes the number of
physical connections to the database.
>
> Current Month >> Opens connection >> Fills Array >>
> Displays results >> Closes Connection.
> Next Month >> Opens connection >> Fills Array >> Displays
> results >> Closes Connection.
>
> If I create the connection to the database and fill the
> array with data in the Header of the HTML page and display
> the contents of the array in the Body of the page, where
> do I erase the array, or do I even need to?
>
You're doing this in client-side code? or are you resubmitting the page and
populating the array in server-side code?

Bob Barrows



Re: Data Access Question by Alastair

Alastair
Wed Sep 17 15:42:17 CDT 2003

Bob,

Thanks for the reply and I am glad that I am doing it the way recommended.
Your comment on resubmitting the page or client side. My intention was to
resubmit the page at the server end. Is this correct?

Thanks again...

Alastair

"Bob Barrows" <reb_01501@yahoo.com> wrote in message
news:OxsRzpRfDHA.1200@TK2MSFTNGP09.phx.gbl...
> Alastair MacFarlane wrote:
> > Dear All
> >
> > I have created a calendar asp page using vbScript that
> > loads data from a SQL database. It highlights the date I
> > have data. Everything works well, however I have one
> > question about the data access procedure and one about
> > erasing the array.
> >
> > I load the data for the current month into an array after
> > opening a connection with the database and then close the
> > connection. If the user then selects the next month,
> > another connection is opened and the values loaded into an
> > array. Like above the connection is closed. Is this the
> > best way to approach it when I will have hundreds of users
> > accessing the SQL Server database at the same time?
>
> Yes. This allows connection pooling to be used which minimizes the number
of
> physical connections to the database.
> >
> > Current Month >> Opens connection >> Fills Array >>
> > Displays results >> Closes Connection.
> > Next Month >> Opens connection >> Fills Array >> Displays
> > results >> Closes Connection.
> >
> > If I create the connection to the database and fill the
> > array with data in the Header of the HTML page and display
> > the contents of the array in the Body of the page, where
> > do I erase the array, or do I even need to?
> >
> You're doing this in client-side code? or are you resubmitting the page
and
> populating the array in server-side code?
>
> Bob Barrows
>
>



Re: Data Access Question by Bob

Bob
Wed Sep 17 16:07:11 CDT 2003

Alastair MacFarlane wrote:
> Bob,
>
> Thanks for the reply and I am glad that I am doing it the way
> recommended. Your comment on resubmitting the page or client side. My
> intention was to resubmit the page at the server end. Is this correct?
>
There's no correct or incorrect about this question. Submitting the form is
one way to do it. When you submit the form, the asp page to which you are
submitting it starts "fresh". This is how an asp page works:

the web server processes all the server-side code on the page, modifying the
html that will be sent to the browser as a result of what the server-side
code does. When everything is complete, the web server sends the response
(the html that will be displayed in the browser) off to the client that
requested it. As far as the web server is concerned at this point, it is
finished with the asp page. Unless caching is involved, it is unloaded from
the server's memory (I'm putting this simplistically). When the client
submits a form to the asp page, the process begins again: the web server
loads the requested asp page, processes the server-side code, etc.

HTH,
Bob Barrows



Re: Data Access Question by Alastair

Alastair
Thu Sep 18 06:12:13 CDT 2003

Bob

Thanks for your help! I am relatively new to asp pages, so
your helpfull comments are appreciated.

Alastair

>-----Original Message-----
>Alastair MacFarlane wrote:
>> Bob,
>>
>> Thanks for the reply and I am glad that I am doing it
the way
>> recommended. Your comment on resubmitting the page or
client side. My
>> intention was to resubmit the page at the server end.
Is this correct?
>>
>There's no correct or incorrect about this question.
Submitting the form is
>one way to do it. When you submit the form, the asp page
to which you are
>submitting it starts "fresh". This is how an asp page
works:
>
>the web server processes all the server-side code on the
page, modifying the
>html that will be sent to the browser as a result of what
the server-side
>code does. When everything is complete, the web server
sends the response
>(the html that will be displayed in the browser) off to
the client that
>requested it. As far as the web server is concerned at
this point, it is
>finished with the asp page. Unless caching is involved,
it is unloaded from
>the server's memory (I'm putting this simplistically).
When the client
>submits a form to the asp page, the process begins again:
the web server
>loads the requested asp page, processes the server-side
code, etc.
>
>HTH,
>Bob Barrows
>
>
>.
>