List:MySQL++« Previous MessageNext Message »
From:Drew M. Date:April 11 2007 3:11pm
Subject:Re: connect and cchar
View as plain text  
The Connection class expects standard C strings passed to it, so if you can
convert to that, it should work.

You can observe this by passing c-string literals into the connect function,
e.g.:

     mysqlpp::Connection con;

     con.connect("db", "host", "user", "password")

-D

On 4/11/07, Marinus Karel tenNapel <mtennapel@stripped> wrote:
>
> Hi,
>
> I want to create a connection to a mysql database with the use of some
> variables. The problem is that these variables are Glib::ustring.
>
> Example:
>         Glib::ustring host = settings.get_key( "host" );
>         Glib::ustring database = settings.get_key( "database" );
>         Glib::ustring user = settings.get_key( "user" );
>         Glib::ustring password = settings.get_key( "password" );
>
>         con.connect(database, host, user, password);
> //Example
>
> The problem is that mysqlpp::Connection::connect is expecting a cchar
> and not a Glib::ustring. So I have been trying to convert my
> Glib::ustring to a cchar. However, I can't get it working. In fact, I
> don't even know what a cchar is, in the first place. Or what should be
> included so I can declare one.
>
> Any help with this would be most welcome.
>
> Thanks a lot anyway :)
>
> Mario
>
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:
> http://lists.mysql.com/plusplus?unsub=1
>
>

Thread
connect and ccharMarinus Karel tenNapel11 Apr
  • Re: connect and ccharDrew M.11 Apr
  • Re: connect and ccharOvidiu Bivolaru11 Apr
    • Re: connect and ccharMarinus Karel tenNapel12 Apr
  • Re: connect and ccharWarren Young11 Apr