title: Alternative to sqlite3_get_table
body: <p>I have a function called isadded() and it was the cause of my program crashing. I run debugdiag and found this </p>
  
  <pre><code>Function     Arg 1     Arg 2     Arg 3   Source 
  ntdll!RtlpWaitOnCriticalSection+df     00001484     00000002     00000000    
  ntdll!RtlEnterCriticalSection+a8     09e10c08     006310a5     09e10c08    
  sqlite3!sqlite3_mutex_leave+17b     09caf370     0c81d9c8     0063d240    
  sqlite3!sqlite3_get_table+99     09caf370     0c81d9c8     0c81d9bc    
  OServHandler!COServHandler::isAdded+17f     059a6fd8     0c8272e0     00000006    
  OServHandler!COServHandler::getHierarchy+ba7     0c940020     00008000     6009fb27    
  AdminConsoleInterface!CAdminConsoleInterface::handleConnection+178     00001254     00000000     00000000    
  AdminConsoleInterface!CAdminConsoleInterface::setOServHandler+33     008c5cd0     0250e9c8     00000000    
  </code></pre>
  
  <p>So, the line where it errs out is sqlite3_get_table(). </p>
  
  <pre><code>sprintf_s(query,1024,"SELECT * FROM OServs WHERE oservname = '%s' ;", cOServID);
  cout&lt;&lt;query&lt;&lt;endl;
  rc = sqlite3_get_table(db, query, &amp;results, &amp;nrow, &amp;ncol, &amp;zErrMsg);
  </code></pre>
  
  <p>Basically I am trying to see if a particular variable is already added in the database. Is there any alternative to this function since it seems to crash? I remember reading that this function was deprecated, but don't know what the alternative is.</p>