|
||||||
| Managed C++ Visual Studio .NET managed C++ Topics |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Depends on what provider your using. OleDb would be something like:
Code:
"Provider=MySQLProv;Data Source=mydb;User Id=UserName;Password=asdasd" |
|
|||
|
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 Code:
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 |
|
|||
|
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.
|
|
|||
|
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.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Don't hesitate to ask any questions that you have! Check out our ASCII Calculator! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial: PHP to MySQL | Jordan | PHP Tutorials | 7 | 08-27-2008 08:56 AM |
| MYSQL CheatSheet - A must for MySQL Users | reachpradeep | Database & Database Programming | 1 | 03-03-2007 03:05 PM |
| Toad for MySQL | Lop | Database & Database Programming | 0 | 12-06-2006 11:07 AM |
| Toad for MySQL 2.0.1 | Kernel | Software Development Tools | 0 | 10-03-2006 06:03 AM |
| MySQL Resources | dirkfirst | Database & Database Programming | 1 | 05-25-2006 02:31 AM |
| John | ........ | 223.00000 |
| dargueta | ........ | 168.00000 |
| Xav | ........ | 164.00000 |
| gaylo565 | ........ | 18.00000 |
| WingedPanther | ........ | 15.00000 |
| |pH| | ........ | 15.00000 |
| Johnnyboy | ........ | 3.00000 |
| navghost | ........ | 1.00000 |
Goal: 100,000 Posts
Complete: 65%