Solved

Upload.LogonUser - password hardcoded

Posted on 2004-08-04
6
571 Views
Last Modified: 2007-12-19
Hi all,

I'm using aspupload
and am using Upload.LogonUser "domain", "usrname", "password".

I'm wondering if there is anyway I could avoid hard-coding the password?

I've tried:

Set dbObj = Server.CreateObject("ADODB.Recordset")
dbObj.ActiveConnection = staff_login
dbObj.Source = "SELECT * FROM tblname WHERE username = '" & Session("username") & "'; "

Set Upload = Server.CreateObject("Persits.Upload")
Upload.LogonUser "domain", dbObj("fieldUsrname"), dbObj("fieldPassword")

but it doesn't work.
it does work if I hardcoded the username and password though....

any idea...?
thanks in advance :D
0
Comment
Question by:wmulyadi
6 Comments
 
LVL 6

Accepted Solution

by:
casstd earned 168 total points
ID: 11722953
Hi,

       You may try this


Conn =  "Provider=sqloledb;Data Source=(local);Initial Catalog=Database;User ID=userid;Password=password"
Set strConn = Server.CreateObject("ADODB.CONNECTION")
strConn.Open Conn

SQL = "Select * from tblname where username='"&session("Username")&"';"
SET rs = Conn.Execute(SQL)
username = rs("Username")                      
password = rs("password")

Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.LogonUser "domain", username, password

Hope it will work
0
 
LVL 3

Assisted Solution

by:JagC
JagC earned 166 total points
ID: 11724072
Always, always always print your variables if you think they should work.

response.write("Usrname= " & dbObj("fieldUsrname") )
response.write("<BR>password = " & dbObj("fieldPassword") )

this will print the values of the fields on the screen. See if they are what they should be. If they look ok and aspupload doesn't work then you have a problem :)
0
 
LVL 9

Assisted Solution

by:leechoonhwee
leechoonhwee earned 166 total points
ID: 11724385
Hmmm.. I think I think the recordset is not opened tatz why

Set dbObj = Server.CreateObject("ADODB.Recordset")
dbObj.ActiveConnection = staff_login
dbObj.Source = "SELECT * FROM tblname WHERE username = '" & Session("username") & "'; "
dbObj.Open()

Set Upload = Server.CreateObject("Persits.Upload")
Upload.LogonUser "domain", dbObj("fieldUsrname"), dbObj("fieldPassword")

0
 

Author Comment

by:wmulyadi
ID: 11728663
I'm out of the office now, and won't
be back until Tuesday, Aug. 10th.
I'll try your inputs when I get there.

Thanks a lot for the inputs.
0
 
LVL 6

Expert Comment

by:masirof
ID: 12708216
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Split: casstd & JagC & leechoonhwee

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

masirof
EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now