|
||||||
| 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;P***word=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;" +
"P***WORD=testp***word;";
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 p***word? 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 | 9 | 09-05-2008 12:12 PM |
| 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 |
| Xav | ........ | 1322.18 |
| MeTh0Dz|Reb0rn | ........ | 1053.7 |
| morefood2001 | ........ | 879.43 |
| John | ........ | 877.37 |
| marwex89 | ........ | 869.98 |
| WingedPanther | ........ | 830.24 |
| Brandon W | ........ | 735.07 |
| chili5 | ........ | 309.39 |
| Steve.L | ........ | 239.84 |
| dcs | ........ | 216.02 |
Goal: 100,000 Posts
Complete: 82%