Results 1 to 5 of 5
  1. #1

    write from script to db

    I have a script which performs a login to a website, and as such the script creates a random username and password each time the script is executed. I would like to record this info somewhere. Obviously a flat file will not work due to file access issues and I don't want one file per Vuser. So the answer seems to write this info to a database. I think I can muddle though with the help file, but I figured that I'm not the first person to try this and I wanted to make sure I wasn't missing something obvious. As I see it I just need to have a db created, then call to it and do an INSERT with each record that I create.

    I love deadlines. I like the whooshing sound they make as they fly by.
    -Douglas Adams

  2. #2

    Re: write from script to db

    If you just want to see the users created why dont you write the o/p into some .txt file or csv file. you can use Fopen, Fwrite, Fclose functions etc


  3. #3

    Re: write from script to db

    True, and I have done that, however you run into file access issues when you increase the number of Vusers as they are all trying to write to the same file. Or, alternatively you could have a seperate file for each Vuser, but that means having to aggregate all of those (potentially hundreds) of files into one file/db/location, because the end purpose is to use that info in later scripts. Sorry, I see that I didn't make that clear previously.

    I love deadlines. I like the whooshing sound they make as they fly by.
    -Douglas Adams

  4. #4

    Re: write from script to db

    You can use 1 file for all others,
    use FileCSVLoadGlobal.
    If there is a synchronisation problem put the write statement in a
    GlobalResourceRelease block.
    Like :

    GlobalResourceEnter("Write", 1);
    FWrite(hFile, sOutput, Strlen(sOutput), OPT_FILE_APPEND, nWritten);

  5. #5

    Re: write from script to db


    Thanks very much for your suggestion. That is exactly what I needed.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:16 PM.

Copyright BetaSoft Inc.