Not really an ideal way of doing it. You should use the SQLClient rather than ODBC. What is wrong in storing the uid/pwd in config file? If you are concerned about security, same things can be done with DSN too. All the person needs to know is how to connect using a DSN, thats all.