Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Unanswered: 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.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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 on the Tiger 800 or the Norton

  3. #3
    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!!!!

  4. #4
    Join Date
    Mar 2004
    Posts
    480
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •