Is there a way to connect to MySQL without a DSN in the system?
DirkFirst Tutorials | Linux Forum
Depends on what provider your using. OleDb would be something like:
Check ConnectionStrings.com for other variations.Code:"Provider=MySQLProv;Data Source=mydb;User Id=UserName;Password=asdasd"
I found a free library that allowed me to connect o mysql without DNS entries.
DirkFirst Tutorials | Linux Forum
I found this which is in C# but you port it to managed C++
You need to download and install this:
http://dev.mysql.com/downloads/connector/net/1.0.html
Taken from http://bitdaddys.com/MySQL-ConnectorNet.htmlCode:string MyConString = "SERVER=localhost;" + "DATABASE=mydatabase;" + "UID=testuser;" + "PASSWORD=testpassword;"; MySqlConnection connection = new MySqlConnection(MyConString); MySqlCommand command = connection.CreateCommand(); MySqlDataReader Reader; command.CommandText = "select * from mycustomers"; connection.Open(); Reader = command.ExecuteReader(); while (Reader.Read()) { string thisrow = ""; for (int i= 0;i<Reader.FieldCount;i++) thisrow+=Reader.GetValue(i).ToString() + ","; listBox1.Items.Add(thisrow); } connection.Close();
Hi >> Saint
Saint said it. I've used that driver before and it preforms very well.
Void
Is this a secure way to connect though? I mean, can't anyone that uses your client to connect be able to retrieve your username and password? You had better think on that before releasing this software to the public. You may end up with an empty DB.
I'm not sure if it is very secure or not. It doesn't seem very secure.....
DirkFirst Tutorials | Linux Forum
It's as secure as the client. In other words, if you've set up DB access correctly so that the login provided only has permissions to do certain things - then anyone with that login only has permissions to do the same things your app does.
In other words - no it's not secure. But it's not really supposed to be either. Security is enforced at the database in this situation.
In other words dirkfirst, you should set grant permissions very limiting from the app connecting to your DB.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks