Form the help of code project members i learn about the ado connection in the c programming..
but the problem is that the program provide the up normal Termination..
my coding is:
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" rename("EOF", "EndOfFile")
struct StartOLEProcess{
StartOLEProcess( ) {
::CoInitialize(NULL);
}
~StartOLEProcess( ) {
::CoUninitialize( );
}
[
]
} _start_StartOLEProcess;
//connection string
ADODB::_ConnectionPtr Con = NULL;
//record set
ADODB::_RecordsetPtr RecSet = NULL;
//single Field Pointer
ADODB::FieldPtr Field;
//Record affected pointer
VARIANT *RecordsAffected = NULL;
//importing Ole variable
StartOLEProcess OLEVar;
int main(int argc, char* argv[])
{
if(Con.CreateInstance(__uuidof(ADODB::Connection)) == 0)
{
printf("sucess\n");
}
Con->ConnectionString = "Driver={MySQL ODBC 3.51 Driver};Server=MyRemoteHost;""Port=3306;Option=4;Database=db;Uid=root;Pwd=""";
Con->ConnectionTimeout = 30;
Con->Open("","","",0);
printf("hai\n");
return 0;
}
my database is mysql..
database name is db1
my user name is root;
and password is nothing..
what is the wrong in that .. why it producing error