DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    PN Guest

    Store huge array into Access database


    I'm trying to store a huge array (600K+ elements) into Access database. Does
    anyone know how? I tried to assigned each array element into each
    field but Access 2000 had a limit of 255 fields. I saved to a binary file
    but the program crashed with overflow error when it reached 8192th array
    element (element type is Single so 8192th is 8192 * 4 = 32,768 bytes which
    is the max. limit of record length). Any help would be appreciated.


  2. #2
    Douglas J. Steele Guest

    Re: Store huge array into Access database

    Create a table with a Long Integer field (call it MyIndex) and another field
    of the same type as the array (call it MyValue).

    Store each array element as a separate row: the element number as the Long
    Integer field, and its value as the other field.

    For lngLoop = LBound(MyArray) to UBound(MyArray)
    rsMyRecordset.AddNew
    rsMyRecordset!MyIndex = lngLoop
    rsMyRecordset!MyValue = MyArray(lngLoop)
    rsMyRecordset.Update
    Next lngLoop

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele


    "PN" <pn66@yahoo.com> wrote in message news:3c65672d$1@10.1.10.29...
    >
    > I'm trying to store a huge array (600K+ elements) into Access database.

    Does
    > anyone know how? I tried to assigned each array element into each
    > field but Access 2000 had a limit of 255 fields. I saved to a binary file
    > but the program crashed with overflow error when it reached 8192th array
    > element (element type is Single so 8192th is 8192 * 4 = 32,768 bytes which
    > is the max. limit of record length). Any help would be appreciated.
    >




  3. #3
    PN Guest

    Re: Store huge array into Access database

    Thanks Doug.
    By the way, do you know how many records can an Access2K hold? If I have 1
    million records, should I consider other databases such as Oracle or MSSQL
    ?

    "Douglas J. Steele" <djsteele@canada.com> wrote in message
    news:3c668e35$1@10.1.10.29...
    > Create a table with a Long Integer field (call it MyIndex) and another

    field
    > of the same type as the array (call it MyValue).
    >
    > Store each array element as a separate row: the element number as the Long
    > Integer field, and its value as the other field.
    >
    > For lngLoop = LBound(MyArray) to UBound(MyArray)
    > rsMyRecordset.AddNew
    > rsMyRecordset!MyIndex = lngLoop
    > rsMyRecordset!MyValue = MyArray(lngLoop)
    > rsMyRecordset.Update
    > Next lngLoop
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    >
    >
    > "PN" <pn66@yahoo.com> wrote in message news:3c65672d$1@10.1.10.29...
    > >
    > > I'm trying to store a huge array (600K+ elements) into Access database.

    > Does
    > > anyone know how? I tried to assigned each array element into each
    > > field but Access 2000 had a limit of 255 fields. I saved to a binary

    file
    > > but the program crashed with overflow error when it reached 8192th array
    > > element (element type is Single so 8192th is 8192 * 4 = 32,768 bytes

    which
    > > is the max. limit of record length). Any help would be appreciated.
    > >

    >
    >




  4. #4
    Douglas J. Steele Guest

    Re: Store huge array into Access database

    There isn't a fixed number. A single MDB can be as large as 2 GB, but you
    can link together multiple MDB files if you have to.

    I've worked with database in excess of a million records.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele


    "PN" <pn66@yahoo.com> wrote in message news:3c66cb99$1@10.1.10.29...
    > Thanks Doug.
    > By the way, do you know how many records can an Access2K hold? If I have

    1
    > million records, should I consider other databases such as Oracle or

    MSSQL
    > ?
    >
    > "Douglas J. Steele" <djsteele@canada.com> wrote in message
    > news:3c668e35$1@10.1.10.29...
    > > Create a table with a Long Integer field (call it MyIndex) and another

    > field
    > > of the same type as the array (call it MyValue).
    > >
    > > Store each array element as a separate row: the element number as the

    Long
    > > Integer field, and its value as the other field.
    > >
    > > For lngLoop = LBound(MyArray) to UBound(MyArray)
    > > rsMyRecordset.AddNew
    > > rsMyRecordset!MyIndex = lngLoop
    > > rsMyRecordset!MyValue = MyArray(lngLoop)
    > > rsMyRecordset.Update
    > > Next lngLoop
    > >
    > > --
    > > Doug Steele, Microsoft Access MVP
    > > http://I.Am/DougSteele
    > >
    > >
    > > "PN" <pn66@yahoo.com> wrote in message news:3c65672d$1@10.1.10.29...
    > > >
    > > > I'm trying to store a huge array (600K+ elements) into Access

    database.
    > > Does
    > > > anyone know how? I tried to assigned each array element into each
    > > > field but Access 2000 had a limit of 255 fields. I saved to a binary

    > file
    > > > but the program crashed with overflow error when it reached 8192th

    array
    > > > element (element type is Single so 8192th is 8192 * 4 = 32,768 bytes

    > which
    > > > is the max. limit of record length). Any help would be appreciated.
    > > >

    > >
    > >

    >
    >




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links