Archive

Posts Tagged ‘QueryDef’

MS Access Pass-through query Error: Cannot execute a select query

June 19th, 2008 No comments

When I tried to run an UPDATE statement from pass-through query, it throwed error “Cannot execute a select query”. This is due to that fact the property ReturnsRecords is set to True which requires the pass through query to return results. If it does not return recordset, it will throw an error. You can correct this error by

  1. Open pass-through query into design mode. Click on Properties button (Alt+Enter) and set Return Records to No
  2. Using program you can set QueryDef object’s ReturnsRecords property to False.
Categories: MS Access Tags: ,

Microsoft Access: why qdf.execute is not showing any warning?

May 31st, 2006 No comments

I had an application in which I had a code like

Dim qdf as QueryDef
qdf = new QueryDef("Query")qdf.execute

The query was not running because of error but the application was not breaking at the time of error generation. To force the application to break/throw exception write the statement like

qdf.execute dbfailOnError

and by this way we can catch all errors.