[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 130
  • Last Modified:

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

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
sbornstein2
Asked:
sbornstein2
1 Solution
 
gary_jCommented:
What are you trying to accomplish?  Are you trying to do this programatically?  Why?
0
 
vinnyd79Commented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now