Solved

Upload.LogonUser - password hardcoded

Posted on 2004-08-04
6
577 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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