Solved

Upload.LogonUser - password hardcoded

Posted on 2004-08-04
6
572 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

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 …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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