//recset.m_pDatabase->ExecuteSQL(L"INSERT INTO Categories (CatID,Category) VALUES('659','gfcgfv')");
recset.m_pDatabase->ExecuteSQL(L"INSERT INTO Categories (CatID) VALUES(?)",x);
if(recset.m_pDatabase->CommitTrans())
TRACE("Transaction Commited\n");
else
TRACE("Error in CommitTrans\n");
// Build the SQL statement for displaying records
SqlString = "SELECT CatID, Category ""FROM Categories";
// Execute the query
recset.Open(CRecordset::forwardOnly,SqlString,CRecordset::readOnly);
// Reset List control if there is any data
ResetListControl();
Getting error at
ExecuteSQL(L"INSERT INTO Categories (CatID) VALUES(?)",x);
error: Too many arguments in function call
As you can see, ExecuteSQL takes a single argument which is a null terminated string.
You're trying to pass two arguments.
PLEASE USE CODE TAGS (the <> formatting button) when posting code. It makes your code easier to to read and it also makes it easier to respond to your post.
In particular, tags not only make your code nicely laid out and colo(u)red, they also add line numbers for all code fragments which are longer than one line. Something we can refer to in our response (I don't have time to line count!)