eswar pothula wrote:
SQLExecDirect(hstmt,(unsigned char *)"insert into emp values(empnum,'ename',esal)",SQL_NTS);
That's wrong. Try to change it to:
const int SIZE = 256;
char sqlcmd[SIZE];
sprintf(sqlcmd, "insert into emp values(%d,'%s',%f)", empnum, ename, esal);
SQLExecDirect(hstmt,(unsigned char *) sqlcmd, SQL_NTS);
of course, in real life, you should check for buffer overruns, etc... :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]