List:MySQL++« Previous MessageNext Message »
From:Alexander List Date:January 26 2008 3:52am
Subject:How to set up connection string
View as plain text  
I want to pre-program the connection information into my system and have it
be able to connect without having to call anything.

Here was the code I was thinking of. It doesn't compile because of a
manifest update error. I think there is a problem with the connection
string. I researched it but couldn't find anything.

Thank you for any help you can provide.

Alex

*******************************************

#include "util.h"

#include <mysql++.h>

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

       cout<< "ello"; //test to make sure it gets here

// Connect to the  database.

       mysqlpp::Connection con(true); //setup con

 

       con.connect("transpass", "192.168.1.55", "allpurpose",
"**truncated**");//(DB, location, usr, pswd) connect to database on local
network (can I specify the database w/ the first parameter?)

       ^^

//Error here? "general error c101008a: Failed to save the updated manifest
to the file ".\Debug\mysql++testing.exe.embed.manifest". The parameter is
incorrect.   mt.exe" 

^^^ this is the error that I get. Am I malforming the connection?

 

       if (!con) { //does this work?

              return 1;

       }

       mysqlpp::Query query = con.query();

       query << "select * from user";

       mysqlpp::Result res = query.store();

 

       // Display the result set

       cout << "We have:" << endl;

       if (res) {

              mysqlpp::Row row;

              mysqlpp::Row::size_type i;

              for (i = 0; row = res.at(i); ++i) {

                     cout << '\t' << row.at(0) << endl;

              }

       }

       else {

              cerr << "Failed to get item list: " << query.error() <<
endl;

              return 1;

       }

 

       string pause;

       cout<< "ello";

       cin>>pause; //so program doesn't automatically close when it is
finished

       return 0;

}

******************************************************

Sorry for the length of the post


Thread
How to set up connection stringAlexander List26 Jan
  • Re: How to set up connection stringNils Woetzel26 Jan
    • Re: How to set up connection stringWarren Young28 Jan