Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBscript to access database without using one login and password 1

Status
Not open for further replies.

Phillipclan

Technical User
Mar 16, 2009
2
GB
I have the following script which allows users to connect to databases, but I wish to use a higher security as to allow them, this I have set up in SQL Logins but want to transfer this to the script how can i do this?

'FBLSLDB Connection string
strConn = "Provider=SQLOLEDB;Data Provider=SQLNCLI;Data Source=FBLSLDB;" & _
"Initial Catalog=Live_App;User Id=Crystal;Password=Crystal"

Dont want them to use Crystal - Crystal.

Your help is apreciated.

PS: Only just started using VB.
 
Assuming user accounts have been created on the SQL server and granted the correct security.

Code:
strUsername = inputBox("Username:")
strPassword = inputBox("Password:")
strConn = "Provider=SQLOLEDB;Data Provider=SQLNCLI;Data Source=FBLSLDB;" & _
 "Initial Catalog=Live_App;User Id=" & strUsername & "Crystal;Password=" & strPassword

Although, passwords will be in plain text. There is a password object (i think) that will hide the chars but I don't know much about it.

-Geates

"I do not offer answers, only considerations."
- Geates's Disclaimer

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top