WHERE clauses not working RRS feed

  • Question

  • I have an application in which all the SQL statements that have a WHERE clause fail with an unknown exception.  For instance if I have executes a statement like “Select * from SomeTableName”  it works, but if the program executes a statement like “Select * from SomeTableName where ColumnName = ‘blah’” it fails.  The statements are valid sql and the program works on most boxes.


    Any Suggestions on what may be causing this issue?


    Thank you,


    Friday, November 16, 2007 4:00 AM


All replies

  • Can u post the code.

    U r statemet is right.

    Generally we will write the stmts like this

    Select * from emp where eno=100

    Select * from emp where ename ='Smith'

    Thank u


    Please remember to click "Mark as Answer" on this post if it helped you.
    Friday, November 16, 2007 4:08 AM
  • I posted something earlier on this but I think I was too detailed and it may have scared people off from answering it.  Here is a link to my earlier post if you are interested in the actual code.

    My Earlier Post

    I am pretty sure the actual code itself is correct.  I am thinking it has to do with some kind of versioning problem.  I know one of the users with this problem is running windows XP service pack 2, Framework 2.0, and the same Jet Engine Version.  I am unable to reproduce this error myself on any of the machines I have installed my application on but I know this has happened more than one time.  Any suggestions on other conflicts that may be causing this issue would be helpful. 

    Thank you for your help,

    Friday, November 16, 2007 4:44 AM
  • If possible I would try compacting the database of the user that is having the problem. It's possible that it may be corrupt. If that doesn't fix the problem then I would expect the user has a configuration issue or bad Jet installation on their machine.

    Friday, November 16, 2007 1:30 PM
  • Thank you for your post.

    1) I have tested the Database and I have been able to open the database on my side so the database is not corrupted. 
    2) If it is a misconfiguration, what should I look at to see if it is configured correctly?  I have asked them to reinstall the framework 2.0, and I checked their version of the Jet Engine. 
    3) Where would I go about getting the latest version of the Jet Engine. 

    Thank you for your assistance,
    Friday, November 16, 2007 1:57 PM
  • See the following:


    How to obtain the latest service pack for the Microsoft Jet 4.0 Database Engine


    I would suspect that it may already be installed given the fact that the environment is XP SP2, but it's worth a try. Troubleshooting Jet installs in this environment is rather difficult and there is no uninstal/reinstall method that I am aware of.

    The only obvious error I noticed in your stack trace was a reference to a missing object called DeckVersion.


    Just another tip, make sure that you're not using any Access or Jet reserved words for your database objects (tables, columns, etc).


    List of Microsoft Jet 4.0 reserved words

    List of reserved words in Access 2002 and in later versions of Access




    Friday, November 16, 2007 2:48 PM
  • hi.

    in char type fields, use this query

    select * form mytable where RTRIM(myfield) = 'hello world'


    Friday, November 16, 2007 2:48 PM

    Please Specify your Code,i think your code will work

    write in this  manner selecr * from tableName where sName='abc'//if string

    Friday, November 23, 2007 7:31 AM