|
||||||
| 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 The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
![]() |
| 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 | 9 | 09-05-2008 01:12 PM |
| MYSQL CheatSheet - A must for MySQL Users | reachpradeep | Database & Database Programming | 1 | 03-03-2007 04:05 PM |
| Toad for MySQL | Lop | Database & Database Programming | 0 | 12-06-2006 12:07 PM |
| Toad for MySQL 2.0.1 | Kernel | Software Development Tools | 0 | 10-03-2006 07:03 AM |
| MySQL Resources | dirkfirst | Database & Database Programming | 1 | 05-25-2006 03:31 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |