The following changes should be made to Microsoft SQL Server Programming DB-Library for C for Microsoft SQL Server 6.0.
The following example correctly shows a typical message-handling function:
#include <sqlfront.h> #include <sqldb.h> int msg_handler(dbproc, msgno, msgstate, severity, msgtext, srvname, procname, line) DBPROCESS *dbproc; DBINT msgno; int msgstate; int severity; char *msgtext; char *srvname; char *procname; DBUSMALLINT line; { printf("SQL Server message %ld, state %d, " "severity %d:\n\t%s\n", msgno, msgstate, severity, msgtext); if (strlen(srvname) != 0) printf ("Server '%s', ", srvname); if (strlen(procname) != 0) printf ("Procedure '%s', ", procname); if (line != 0) printf ("Line %d", line); return(0); }