arrays in Access 
Author Message
 arrays in Access

I am writing some ASP code using VBScript.
I want to store the value of a numeric array to the database.
(e.g. Jan(1:31), Feb(1:29), etc.)

Hmmm.. short of having 366 fields (one for each day of the year), can I
write the entire month
to a single field?

Thanks!



Mon, 26 Jul 2004 20:36:32 GMT  
 arrays in Access
dim iYear(12,31) as integer
const Jan = 1
const Feb = 2.....

iyear(jan,iday0 = value


Quote:
> I am writing some ASP code using VBScript.
> I want to store the value of a numeric array to the database.
> (e.g. Jan(1:31), Feb(1:29), etc.)

> Hmmm.. short of having 366 fields (one for each day of the year), can I
> write the entire month
> to a single field?

> Thanks!



Mon, 26 Jul 2004 22:24:30 GMT  
 arrays in Access
Turn the array into a delimited string using Join() and store the string.  On retrieval from the db, use Split() on the delimited string to return it to an array.

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> I am writing some ASP code using VBScript.
> I want to store the value of a numeric array to the database.
> (e.g. Jan(1:31), Feb(1:29), etc.)

> Hmmm.. short of having 366 fields (one for each day of the year), can I
> write the entire month
> to a single field?

> Thanks!



Tue, 27 Jul 2004 01:39:49 GMT  
 arrays in Access
Brilliant...

The array part wasn't a problem in VBScript, only in storing it.

Your solution is perfect.

thanks again!


Turn the array into a delimited string using Join() and store the string.
On retrieval from the db, use Split() on the delimited string to return it
to an array.

--
Michael Harris
Microsoft.MVP.Scripting
--


Quote:
> I am writing some ASP code using VBScript.
> I want to store the value of a numeric array to the database.
> (e.g. Jan(1:31), Feb(1:29), etc.)

> Hmmm.. short of having 366 fields (one for each day of the year), can I
> write the entire month
> to a single field?

> Thanks!



Tue, 27 Jul 2004 06:06:21 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. dbGonzales - the OODB for Delphi

2. tsfaqp26.zip Common Turbo Pascal Questions and Timo's answers

3. BDE w/alias and Installshield prompts for login

4. Why is ' ' an inaccessible value?

5. arrays in Access

6. PLEASE HELP!! Dynamic arrays and Access reports

7. Array and Access DB reports

8. Using VBA to populate array from Access table

9. Arrays and Access objects

10. Arrays in Access 97

11. Sorting an array in Access 2.0

12. control arrays in Access 2000?

 

 
Powered by phpBB® Forum Software