Mike Baranski writes:
> This gives me a seg fault, I know I have the correct user/pw, but I can't get the
>thing to run past "First", any ideas why the connect is not working properly?
>
> #include <iostream.h>
> #include <sqlplus.hh>
> #include <string>
>
> void main()
> {
> string dbname = "test2";
> string hostname = "localhost";
> string uname = "mike";
> string paswd = "1woodydogCONIFER2701Cmwb2diG";
>
>
> cout << "First\n";
>
> Connection con(dbname.c_str(), hostname.c_str(),
> uname.c_str(), paswd.c_str());
> cout << "Second\n";
>
> Query query = con.query();
> cout << "Third\n";
>
> query << "CREATE DATABASE MWB";
> cout << "Fourth\n";
>
> Result res = query.store();
> cout << "Fifth\n";
>
> }
>
>
> Thanks!
> MWB.
>
HI!
As it is outlined in many places in our manual streaming a Query
object should be performed only with commands that return a result
set, like SELECT, SHOW, DESCRIBE etc ....
For other stuff, like CREATE, use exec() method.
Regards,
Sinisa
____ __ _____ _____ ___ == MySQL AB
/*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
/*/ /*/ /*/ \*\_ |*| |*||*| mailto:[EMAIL PROTECTED]
/*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus
/*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____
^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
/*/ \*\ Developers Team
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php