Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010
    Posts
    2

    Question Unanswered: MySQL & ASP // Password()

    I am not sure how to use the Password function on my insert statement in classic ASP.

    I am trying:

    strSQL = "INSERT INTO Accounts (FirstName, LastName, EmailAddress, UserPassword, Hashkey, CoDiv, CreateDate) Values( '" & _
    fname & "','" & _
    lname & "','" & _
    email & "','" & _
    pwd & "','" & PASSWORD(email & CoDiv) & "','" & _
    CoDiv & "',NOW())"

    The error I am getting is:

    Microsoft VBScript runtime error '800a000d'

    Type mismatch: 'PASSWORD'

    I guess I need to somehow Insert the record and then run a procedure in MySQL after the Insert to populate the Hashkey column?

    How do I do that?

    Thank you very much.

  2. #2
    Join Date
    Feb 2010
    Posts
    2

    I was able to move this into a Procedure

    DELIMITER $$

    DROP PROCEDURE IF EXISTS `wishlist`.`InsertNewAccount` $$
    CREATE PROCEDURE `wishlist`.`InsertNewAccount` (fName VARCHAR(50),
    lName VARCHAR(50),
    email VARCHAR(50),
    pwd VARCHAR(50),
    CoDiv VARCHAR(50),
    OUT AccountId INT
    )
    BEGIN

    DECLARE HKey VARCHAR(50);

    Set HKey = PASSWORD(CONCAT(email,CoDiv));

    INSERT INTO Accounts (FirstName, LastName, EmailAddress, UserPassword, HashKey, CoDiv, CreateDate)
    Values(fName, lName, email, pwd, HKey, CoDiv, Now());

    #Set value of OUT parameter
    SELECT accountsId INTO AccountId;

    END $$

    DELIMITER ;


    Can someone tell me how to properly OUTPUT the accountsID column value?
    accountsId is an auto_increment column of the row we just inserted.

    Can that be sent back to ASP?

Tags for this Thread

Posting Permissions

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