Application Scope Array, FileScripting or Database

Results 1 to 3 of 3

Thread: Application Scope Array, FileScripting or Database

  1. #1
    Paul McLachlan Guest

    Default Application Scope Array, FileScripting or Database

    Hi all. Hoping someone might be able to help me out with whether I&#039m doing something as efficiently as possible.<BR><BR>The homepage on my site gives information based on what date it is (a daily quote, daily reference items, etc.).<BR><BR>Currently, I get my page to work out the Julian Date and then open a FileScripting object to open a "quotes.txt" file and a "holidays.txt" file and scroll through to whichever line corresponds to today&#039s day of the year for that visitor (366 lines in each file), read that line and store it in a String ready to write to the page.<BR><BR>Would it be more efficient from a server-load and speed point of view to:<BR><BR>a) store the data in my database and have the page open a connection, pull all the data in a row for the particular date and then store it in local variables on the page? or<BR><BR>b) put all the data in a big array and store it as an Application collection?<BR><BR>The data doesn&#039t change. I enter it all before the New Year and then don&#039t need to touch the files all year.<BR><BR>Is putting such a large array in an Application collection a problem?<BR><BR>I&#039ve thought about having a script connect to the database once per day (say when the system detects that someone has requested a page after the day changes) and storing the value at Application level for the rest of the day, but I have visitors on both sides of the International Date Line and I was having trouble working out how to deal with that.<BR><BR>I use MS Access as my database, and while it&#039s never fallen over on me, I only ever connect to it when absolutely necessary (ie, for dynamically changing data) because of all the stuff I&#039ve read about how poorly it copes with heavy user loads. So, I&#039m assuming a database connection isn&#039t the best option.<BR><BR>Thanks for your help,<BR>PDM.

  2. #2
    Richard A. Lowe Guest

    Default RE: Application Scope Array, FileScripting or Data

    Hi,<BR><BR>I believe your best option would be a hybrid.<BR><BR>Use the Window Scripting Host aong with an AT job run at midnight to load a new quote into a string application variable. You keep the application variable small and only connect to the database once a day at a quiet time.<BR><BR>Any probs or questions, email me<BR><BR><BR>Richard.

  3. #3
    Join Date
    Dec 1969

    Default RE: Application Scope Array, FileScripting or Data

    well i would put the data in a database and use a vb function that grabs the day out of the year it is the index inside of the database like so<BR>x = DatePart("y",now)<BR>this will return a number between 1 and 366<BR>then the sql would be<BR>sql ="select * from tablename where id=" & x<BR>that should do it <BR>it will go pretty fast as long as you do not have more than about 50 users at any given time

Posting Permissions

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