Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi all,
Iam new to BMP. I want to create a table in the database. For that i have used the following code: to create a statement object. Iam able to successfully creat a connection, but not able to create statement object.

int tail =0;
char *querry ="create table dummy(name varchar(20));";

if(ISHELL_CreateInstance(pMe->pIShell,AEECLSID_Env,&pMe->ienv)!=SUCCESS)
{
return FALSE;
}
if(IEnv_CreateInstance(pMe->ienv,dbc_AEECLSID_Factory,&pMe->ifact)!=SUCCESS)
{
return FALSE;
}
if(dbc_IFactory_Open
(pMe- >ifact,"fs:/~0x003458A8/test.db",dbc_CFLG_RWC|dbc_CFLG_WIDE,&pMe->iconn)!=SUCCESS)
{
return FALSE;
}

if(dbc_IConnection_CreateStatement16(pMe->iconn,querry,&tail,&pMe->istmt)!=SUCCESS)
{
return FALSE;
}

can anyone suggest what iam doing wrong.
Is the way iam specifying querry correct?PLs help urgent

With dbc you have the option of passing either a utf-8 or utf-16 string to create the statement. It looks like you are attempting to pass a utf-8 string into the function that accepts utf-16 string.
Maybe you can try calling dbc_IConnection_CreateStatement instead.
And don't forget to call ExecuteUpdate to actually execute your statement.

With dbc you have the option of passing either a utf-8 or utf-16 string to create the statement. It looks like you are attempting to pass a utf-8 string into the function that accepts utf-16 string.
Maybe you can try calling dbc_IConnection_CreateStatement instead.
And don't forget to call ExecuteUpdate to actually execute your statement.