dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Different coding for a connection string? Password visable

  1. #1
    Join Date
    Nov 2005
    Posts
    46

    Different coding for a connection string? Password visable

    Different coding for a connection string? Password visable

    What is the proper way for connection string?

    I have noticed in some tutorials, they use coding for the
    connection string that shows the sa PASSWORD:

    Dim sConnectionString As String = _
    "server=Dozer;uid=sa;pwd= MyPassWord;database=Northwind"
    Dim sSQL As String = "SELECT * FROM Products"


    I can use the following that does not show the password:

    Dim sConnectionString As String = _
    "workstation id=DOZER;packet size=4096;_
    integrated security=SSPI;data source=Dozer;" & _
    "persist security info=False;initial catalog=Northwind"

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    If you can use Windows authentication (SSPI), you should. Some applications, such as those running on Windows 9x, require SQL Server authentication. You do not, however, have to include the password in your connection string; you can provide it in your code as a parameter to the connection's .Open method. And you should never use the sa account in a real application; create a SQL account (or several, with varying permissions) specific to your application and grant it only the permissions it needs.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. if statements
    By airrazor in forum Java
    Replies: 11
    Last Post: 11-06-2005, 11:18 AM
  2. Input string was not in a correct format
    By mdengler in forum ASP.NET
    Replies: 0
    Last Post: 11-26-2002, 03:32 PM
  3. Deadlock error.. how to remove
    By Chandra in forum VB Classic
    Replies: 0
    Last Post: 06-22-2000, 12:52 PM
  4. Replies: 0
    Last Post: 06-22-2000, 07:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center