Lost Password?

Go Back   CodeCall Programming Forum > Software Development > C and C++ > Managed C++

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

Managed C++ Visual Studio .NET managed C++ Topics

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-30-2006, 08:24 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Credits: 0
Rep Power: 11
dirkfirst is on a distinguished road
Default Connecting to MySQL without DSN

Is there a way to connect to MySQL without a DSN in the system?
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-31-2006, 10:38 AM
brackett brackett is offline
Programmer
 
Join Date: May 2006
Posts: 193
Credits: 0
Rep Power: 10
brackett is on a distinguished road
Default

Depends on what provider your using. OleDb would be something like:
Code:
"Provider=MySQLProv;Data Source=mydb;User Id=UserName;P***word=asdasd"
Check ConnectionStrings.com for other variations.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-31-2006, 07:37 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Credits: 0
Rep Power: 11
dirkfirst is on a distinguished road
Default

I found a free library that allowed me to connect o mysql without DNS entries.
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-01-2006, 11:18 AM
Saint Saint is offline
Learning Programmer
 
Join Date: Aug 2006
Posts: 63
Credits: 0
Rep Power: 9
Saint is on a distinguished road
Default

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();
Taken from http://bitdaddys.com/MySQL-ConnectorNet.html
__________________
Hi >> Saint
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-02-2006, 11:37 AM
Void's Avatar   
Void Void is offline
Programming Expert
 
Join Date: Jun 2006
Posts: 410
Credits: 0
Rep Power: 11
Void is on a distinguished road
Default

Saint said it. I've used that driver before and it preforms very well.
__________________
Void
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 09-05-2006, 11:17 AM
Ronin Ronin is offline
Programming Professional
 
Join Date: Apr 2006
Posts: 299
Credits: 3
Rep Power: 10
Ronin is on a distinguished road
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 10-03-2006, 06:11 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Credits: 0
Rep Power: 11
dirkfirst is on a distinguished road
Default

I'm not sure if it is very secure or not. It doesn't seem very secure.....
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 10-04-2006, 04:14 AM
brackett brackett is offline
Programmer
 
Join Date: May 2006
Posts: 193
Credits: 0
Rep Power: 10
brackett is on a distinguished road
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 10-07-2006, 09:58 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,330
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -5. The time now is 01:31 AM.

Contest Stats

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

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 82%

Ads