Hallo Everyone

I need help in vb with databases what I want to do is connect to Pastel data with ODBC which I have done and then export the data to excel which I have also done but my problem is when I want to search the tables by using the date It gives me a Pervasive ODBC error and then quits the program this is really urgent any help would do but source code will also be helpfull