Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2012
    Posts
    4

    Unanswered: save to mysql with vbs

    I been using this code to email the staff every day when there password has 14 days until it locks them out. It logs to a text file and off it goes i want it to log to a db and not to a text files as i had befor. But i am missing somthing it write and updates the db but adds the same user in 39 times. Then does the next user 39 times. It's getting the 39 becasue there are 39 users that need to change there windoes password.

    I must be missing somthing but i don't know what i think i am putting the write db code in the worng place.

    The code is in the text file i attached to this post
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2012
    Posts
    4

    can some one take a look ?

    can any one help

  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Well...

    in your code, you have a line

    Code:
    Dim strPrinterQry : strPrinterQry = "Select * From users "
    Shouldn't this have a where clause? Something like

    Code:
    Dim strPrinterQry : strPrinterQry = "Select * From users  WHERE expire_date <= " & now() + 14
    using properly formatted dates and 14 day intervals? This would limit the recordset to only those users whose passwords expire in the next 14 days...
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  4. #4
    Join Date
    Mar 2012
    Posts
    4
    no becasue it's looking in the user db

    the code runs a query on ldap for any user that has 14 days until expire

    it need to insert the user name and the expire date and time in to the db

    then when it runs again it need to read all the usernames and update if there in the db if not add the new users.

Posting Permissions

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