Results 1 to 10 of 10

Thread: Security Access. Any Help?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Santo Domingo,D.N., Dom. Rep.
    Posts
    707

    Talking Security Access. Any Help?

    My App need to CONNECT to a Server(SQL). I need to KNOW the user and password in order to connect to the DATABASE. The Question is:

    1. If i know the USER AND PASSWORD Where is the "SECURITY"?
    2. How can i connect to a database calling the user and the password without Knowing ? I meant, if there is a way to have the user and password on a file(script of course) or anyother way?

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    in DAO:
    dim db as database

    Set db = DBEngine.Workspaces(0).OpenDatabase("C:\DATABASES\Database.MDB", False, False, ";pwd =fred;")

    in ADO

    dim CnXn as ADODB.Connection
    Set Cnxn = New ADODB.Connection
    strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDBatabase Password =condon;Data Source=C:\DATABASES\Database.mdb;Jet OLEDB:Engine Type=4;"
    Cnxn.Open strCnxnTech

  3. #3
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    Last line should read:

    Cnxn.Open strCnxn

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Santo Domingo,D.N., Dom. Rep.
    Posts
    707
    Yes, my friend i agree with you. but i still know the password and the user. What i need i to GET the password and the user from somewhere as a variable and pass those values to SQL or ANY DATABASE, but without KNOWING THE VALUES.

    Is that possible?
    Should I have to have those values always on my program or on a INI FILES?

  5. #5
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    I would recommend storing those values in the registry. Then just read the registry at startup and store the values in a global variable.

    Here are some links to show you how:
    Using GetSetting/SaveSetting
    Using API
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  6. #6
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    I find the problem with storing that data in the registry is that by using regedit, you can see the "secure" data.

    By having it in my source code, I control who can see it (nobody but me).

  7. #7
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    If you encrypt the data in the registry, it shouldn't be a problem. I would rather use the registry to store this data than an INI file as end-users are most likely more comfortable with using Windows Explorer (if the O/S is Windows based) than using regedit.

    If you always want to log on using the same ID, and you know there is no chance that that ID will be dropped, then you could probably go ahead and hard code the ID and password in your app.
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  8. #8
    Addicted Member
    Join Date
    Aug 2000
    Location
    Pennsylvania, USA
    Posts
    168
    How is your program running? If it is interactive, prompt the user for his/her name and password. If it is scheduled, schedule using a windows NT/2000 account, and give that account access to SQL Server.

    Or you could store in the registery, but definetly encrypt the password.
    Wydok

    "It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years."

    -John Von Neumann ca. 1949

  9. #9
    Member
    Join Date
    Nov 2002
    Location
    Michigan
    Posts
    54

    Encryption

    If you are looking at Encrypting I found this thread posted in General VB Questions which may be of help for you



    http://www.vbforums.com/showthread.p...hreadid=211187

  10. #10
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Yo no need for all that jazz.

    It's an SQL server db...
    VB Code:
    1. cn.Provider = "sqloledb"
    2. cn.Properties("Prompt") = adPromptAlways
    3. cn.Open "Data Source=TheServerName;" & _
    4.            "Initial Catalog=TheDatabaseName"

    This will prompt for username and password.

    That way you dont code it, it's up to the user.
    Else you ask them to enter it in a login form.

    good luck
    b

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width