[Updated]:
char buffer[1024] = {0,};
sprintf(buffer,"SELECT tblIP.[IPAddress], tblIP.[IPType], tblIP.[IPStatus], tblIP.[IPMax] FROM tblIP WHERE tblIP.[IPAddress]= %s AND tblIP.[IPType]=3 AND tblIP.[IPStatus]=1 AND tblIP.[IPMax]=0;",ipSrc);
SQLCHAR* query = (SQLCHAR*)buffer;
Use a single line for the sprintf call
Best regards
Espen Harlinn