I'm following the exmple in the book MySQL by Paul DeBous (chapter 6 The
MySQl C API page 225).  I am getting an error about "Too many types in
declaration"
 
Do I need to download any special libraries - currently I am using the
ones in the mysql-3.23.38a-win-src.zip file (mysql.h, mysql_com.h,
mysql_version.h)
 
////////////////////////////////////////////////////////////////////////
////////
// Program: Client proggie to connect to mysql server.  Server options
are
// specified by the user
// Aim: To retrieve data from table specified by user in microsoft
access format
// and insert the table into a microsoft access database of the users
choice
//
//  Command line version of the program currently being investigated
//  i.e. c:\this_proggie -h host -u user -p pass -po port
//
// Start of development: 24th May 2001
// Date modified: 27th May 2001
// Author: David Ayliffe
// Version: 0.1
////////////////////////////////////////////////////////////////////////
////////
 
#include <stdio.h>
#include <iostream.h> // libraries included in the linked (object) file
#include <conio.h>
#include "mysql.h"   // include the mysql libraries copied from the win
        // source download
 
#define def_host_name NULL /*host to connect to (default localhost) */
#define def_user_name NULL /*user name for the database (default login
name) */
#define def_password  NULL /*password for the database (default is null)
*/
#define def_db_name   NULL /*default database (default database default
none) */
#define def_svr_port  NULL /*port to connect to (defualt 3306) */
 
MYSQL  *conn;              /*pointer to the connection handle */
 
int main ()
{
/* clrscr();
 cout << "Enter the host name (default localhost): ";
 cin >> def_host_name;
 cout << "Enter the user name (default root): ";
 cin >> def_user_name;
 cout << "Enter the password (default blank): ";
 cin >> def_password;
 cout << "Enter the database name (default none): ";
 cin >> def_db_name;
 cout << "Enter the port (default 3306): ";
 cin >> def_db_name;                                   */
 
 // the real work starts here
 
 conn = mysql_init (NULL);
 mysql_real_connect (
      conn,                  // pointer to connection handle
      def_host_name,         // host to connect to
      def_user_name,         // user name to connect as
      def_password,          // password to use
      def_db_name,           // database to use
      def_svr_port,          // port to connect through
      NULL,                  // socket
      0);                    // flags
 
 mysql_close (conn);
 return 0;
}
 
 
Thanks lots
David Ayliffe ([EMAIL PROTECTED])
 

Reply via email to