SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Jan 2002
    Posts
    120
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to redim array for SQLRetrieve?

    Hi, all!
    My question is about dimensions of array for querying database. Currently I just set some dimensions for array where I put results of querying (it is SQLResArray). But I cannot be sure that these dimensions are enough. How can I redim this array to fit all query results? Here is how it works in my code:

    Dim SQLResArray(1 To 10, 1 To 500) As Variant
    Query="SELECT ComponentID, ComponentName FROM Component ORDER BY Sequence, ComponentName"
    RetCode = SQLExecQuery(DBConnection, Query)
    if RetCode>0 then
    RetCode=SQLRetrieve(connection:=DBConnection, destination:=SQLResArray)
    end if


    ------------------

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Montreal, QC, Canada
    Posts
    366
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to redim array for SQLRetrieve?

    You need to use the parameter
    maxRows% An integer and an optional parameter, used to specify the number of rows to be retrieved in the request.

    The array is fine, you just keep retrieving until nothing is left. This is extracted from the help file, HTH,

    The return value is the number of rows in the result set or the maxRows requested. If the function is unable to retrieve the results on the specified connection, or if there are not results pending, -1 is returned. If no data is found, the function returns 0.

    The arguments are named arguments. The return is a variant.

    If maxColumns or maxRows are omitted, the array size is used to determine the maximum number of columns and rows retrieved, and an attempt is made to return the entire result set. Extra rows can be retrieved by using SQLRetrieve again and by setting fetchFirst to 0. If maxColumns specifies fewer columns than are available in the result, SQLRetrieve discards the rightmost result columns until the results fit the specified size.

    Max

    ------------------

  3. #3
    Senior Member
    Join Date
    Jan 2002
    Posts
    120
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to redim array for SQLRetrieve?

    That's it, thank you very much! I just wonder when this time will come when I will read all available help attentively...

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:05 AM.

Copyright BetaSoft Inc.