Well, you still left out the directories for the project (properties), but maybe I don't need it anyway. Here is how you would retrieve the record count from the Combo table where Naam='Hamer'... That is to say that I tested by passing in "Hamer" to the method.
public static int GetRecCount(string naam)
{
string database = @"c:\AccessDbs\Calaesto.mdb";
string connParams = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}";
string connStr = string.Format(connParams, database);
OleDbConnection conn = new OleDbConnection(connStr);
string SQLString = "SELECT Count(*) FROM Combo WHERE Naam = '" + naam + "'";
try
{
conn.Open();
using (OleDbCommand cmd = new OleDbCommand(SQLString, conn))
{
int rows = (int)cmd.ExecuteScalar();
return rows;
}
}
catch (OleDbException ex)
{
Console.WriteLine("Exception: {0}\r\n Stack Trace: {1}", ex.Message, ex.StackTrace);
System.Diagnostics.Debugger.Break();
}
finally
{
conn.Close();
}
return -1;
}