Solved

How to pass a username and password into a VB application Project Prop - Make - Command Line Argument

Posted on 2004-10-05
4
123 Views
Last Modified: 2010-05-02
How can I pass a SQL username and encrypted password into the Command Line Argument under Project Properties and then the Make tab?  How can I get the encryption of the password /P in there?  Thanks all
0
Comment
Question by:sbornstein2
4 Comments
 
LVL 5

Expert Comment

by:gary_j
ID: 12230302
What are you trying to accomplish?  Are you trying to do this programatically?  Why?
0
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 50 total points
ID: 12474239
To get command line args you don't need to specify them under the make tab. The Command$ string will pass all arg's to your app so you can parse them and process them accordingly.For example:

Private Sub Form_Load()

If Command$ <> "" Then
    Dim arrArgs() As String, i As Integer
    arrArgs = Split(Command$, " ")
   
    For i = 0 To UBound(arrArgs)
        MsgBox arrArgs(i)
        If i = 0 Then MsgBox "UserName is " & arrArgs(i)
        If i = 1 Then MsgBox "Password is " & arrArgs(i)        
    Next i

End If
End Sub

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

863 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

22 Experts available now in Live!

Get 1:1 Help Now