Solved

Upload.LogonUser - password hardcoded

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

19 Experts available now in Live!

Get 1:1 Help Now