If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Need help on connecting to mysql.. ( total newbie here =( )

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-20-09, 00:21
blackheartedangel blackheartedangel is offline
Registered User
 
Join Date: Jan 2009
Posts: 2
Need help on connecting to mysql.. ( total newbie here =( )

Hi, I have been searching thru the net for the past 4 days and i am stuck at this problem badly so i hope anyone here can help me =(. Extremely new to mysql.


I am currently using VC++ for this I am trying to connect to mysql and i am unable to connect it.


System::Void SelectTable()
{

ADODB::Recordset ^ rst;
rst = gcnew ADODB::Recordset();
conADO = gcnew ADODB::Connection();
System:ata:qlClient:qlConnection ^ConnectDatabase = gcnew System:ata:qlClient:qlConnection(L"Server =localhost;"
L"Database=Data\\Database.mdb;"
L"Persist Security Info=true;"
L"User ID='root';"
L"Password='123456'" );


try
{
ConnectDatabase->Open();

System::Console::WriteLine(" File opened");
}
catch(System::Exception ^e)
{
System::Console::WriteLine("Error : " + e->ToString());
}

}


I think i am doing something wrong with connection part. I tired with changing the "server" part in the connection to Server = 127.0.0.1 and it still don't work.

i have the mysql server when trying to connect to it.

Error : System.Data.SqlClient.SqlExpection: An error has occurred while establishing the connection to the server. When connecting to SQL Server 2005 , This failure may be caused by the fact under the default settings SQL server does not allow remote connections. ( provider : Named Pipes Provider, error: 40 - Could not open Connection to Sql server )


Anyone Can help guide me through this? Been searching thru the net all i get are mainly php examples.
Reply With Quote
  #2 (permalink)  
Old 01-20-09, 03:14
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 8,734
are you using MySQL or SQL server?
the compiler thinks you are using SQL Server, yet your thread title suggests you are trying to use MySQL

there are, or at least were last time I looked, plenty of web pages tat detail how to conect to MySQL from VC++.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 01-20-09, 04:45
blackheartedangel blackheartedangel is offline
Registered User
 
Join Date: Jan 2009
Posts: 2
Hmx..... oh my.... >.<
Think ur right just realised.

I'll try another way. Did not know SQL and MySQL were diff then again i am a total newbie trying to under stand this thing Thanks man... Now i am trying a different way hope it works. Thanks!!!!
Reply With Quote
  #4 (permalink)  
Old 01-20-09, 10:14
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 435
SQL is Structured Query Language, it is the language that all database applications use to process their queries.

There are many different database applications, among them: SQL Server, MySQL, Oracle, Postgres and others.
Reply With Quote
Reply

Thread Tools
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On