If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MySQL & ASP // Password()

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-26-10, 09:50
SamuraiCoder SamuraiCoder is offline
Registered User
 
Join Date: Feb 2010
Posts: 2
Question 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.
Reply With Quote
  #2 (permalink)  
Old 02-26-10, 16:59
SamuraiCoder SamuraiCoder is offline
Registered User
 
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?
Reply With Quote
Reply

Tags
password(), procedure, sproc, trigger

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On