I am trying to connect to MySQL server over MySQL ODBC 3.51 driver. Borland C++ 5.02 is the tool I use.
I tried a simple connection code below:
Expand|Select|Wrap|Line Numbers
- #include <stdio.h>
- #include <stdlib.h>
- #include "mysql.h"
- MYSQL mysql;
- int dum;
- int main()
- {
- mysql_init(NULL);
- if (!(mysql_real_connect(&mysql,"localhost","onur","pass","mysql",0,NULL,0)))
- {
- printf("Connection failed.");
- scanf(" %d",dum);
- }
- else
- {
- printf("Connected.");
- scanf(" %d",dum);
- }
- mysql_close(&mysql);
- return 0;
- }
mysql_com.h( 184, 15 ) : Type name expected
mysql_com.h( 184, 15 ) : Declaration missing ;
mysql_com.h( 354, 26 ) : 'SOCKET' cannot start a parameter declaration
Could anyone help me?
Thanks in advance.