Link to home
Start Free TrialLog in
Avatar of ohemaa
ohemaa

asked on

Script for ODBC

Is there a script to set up DSN ODBC where I can hard code username and password to avoid been prompted each time?
Avatar of James Murrell
James Murrell
Flag of United Kingdom of Great Britain and Northern Ireland image

SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you are using the SQL Server ODBC driver, it doesn't matter if you put the password in DSN, it will not pick it up and use it. It isn't designed that way.

I have VBA module that will create a DSN on the fly, and I know of several other methods of doing it depending on constraints.

Can you give us a little more detail on what you are trying to accomplish?
Avatar of ohemaa
ohemaa

ASKER

trying to create DSN with username and password embedded in the code so that users do not get prompted for the username and password whenever they try to access an application via the DSN/ODBC
What is your front-end? You will have to do it there.

If it is Access, when you link the tables on the lower right is a check box for Save Password. Turn that on, and that should solve the problem.
Save-ODBC-Password.gif
Avatar of ohemaa

ASKER

SQl server
SQL server is generally considered the back-end. You have some sort of application that connects to the SQL Server. Depending on how that is designed is whether you can save the password.

The other option is to use Active Directory users and groups with trusted connections.
Avatar of ohemaa

ASKER

Crystal reports
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ohemaa

ASKER

Leew..thanks for your comments above.
Glad to be of assistance. May all your days get brighter and brighter.