Results 1 to 5 of 5

Thread: Speed this up?

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Speed this up?

    Ive got some SQL that will be dumping large amounts of data out to CSV files for excel to open

    currently I have it looping through each line and dumping it into the CSV. is there a way to get ALL the results from the SQL into one string without having to loop through?

    EX:

    SQL = "Select FName ||','|| LName from Customers"

    [open RS here]
    [Open CSV file]

    Do while No Rs.EOF
    Print #1, rs.fileds(0).value
    loop

    etc.
    etc.

    is there a command or something that has ALL the data without having to use the Do While?

    thnx
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243
    Have you tried rs.GetString ?

    It should do what you are after.
    Web/Application Developer
    VB6 Ent (SP5), Win 2000,SQL Server 2000

  3. #3

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    ok tried playing with it..cant seem to get it to work right?

    How do you use it?

    what about .getrows? ever try that?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243
    GetString is the one you want.

    How is your data stored in the recordset and how do you want it to be formatted?
    Web/Application Developer
    VB6 Ent (SP5), Win 2000,SQL Server 2000

  5. #5

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    Data is a Single field (comma seperated) its going to be dumped to a .CSV file for Excel to open.

    I tried the get rows....then I can dump each line in a for next loop seems to be faster then going directly from the RS.


    Unless I can grab all at once (with getstring) and split every 1000 lines?

    0 - 1000 into first file
    1001 - 2000 into 2nd etc...

    thanx S@NSIS
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

Posting Permissions

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



Click Here to Expand Forum to Full Width