C++ SQL AddRow and other things .. important!

BOOL DataGrid::SQL_Add(int Index)
{
DG_Row * Actual;
Actual = SelectRow (Index);
DG_Item * ActualItem = Actual->Items;

for (register int n = 0; n < Grid.NumColumns; n ++)
{
if (SQLBindCol (Datasource_SQLStatus,n+1,SQL_C_CHAR,ActualItem->Data,strlen (ActualItem->Data),NULL) != SQL_SUCCESS) return FALSE;
ActualItem = ActualItem->NextItem;
}

if (SQLSetStmtAttr (Datasource_SQLStatus, SQL_ATTR_ROW_ARRAY_SIZE, (void *) 1, 0) != SQL_SUCCESS) return FALSE;
if (SQLBulkOperations (Datasource_SQLStatus,SQL_ADD) != SQL_SUCCESS) return FALSE;

return TRUE;
}
--------------------------------------------------------------
I have a datagrid, and I want to use a row (DG_Row) to create a new Row in a Database. But the code above doesn't work. Could someone rearrange this code, or give me an example how to create a new row in another way ?

And could someone show me a fast way to edit fields in a database ?

It's very important, so please help me.

Thanks

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories