What's the point of an ODBC driver if I have to hard code a username and password into my program?

  • The project I'm working on has me jumping back and forth between C++ and Qt Framework. (The significance of that sentence will become clear in a bit, bear with me) I have to communicate with a SQL db in both my C++ program and my Qt program. I had my Qt program running correctly. It was my first Qt program and I harvested a lot of examples offline to get it working. It could comm with the db add, modify, and return data. Once working with the C++ program I changed the user password. Then without thinking jumped back to my Qt program. Of course it wouldn't work . I found the issue but it made me think, what is the point of a ODBC driver, I have to enter a username and password in it to get the ODBC driver working? Does it not store this information? I would prefer not hard coding the username and password in the Qt program because if I ever have to change them I don't want to recompile my program and add it to the comps i'm working with to get everything working again. I would prefer to just update the ODBC driver and everything is happy again.

    Am I missing something here?

  • Lifetime Qt Champion


    I'm not used to ODBC, but generally, if a username and password is required for something, it's usually done in the application settings rather than hardcode it.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.