Log in

View Full Version : To open a adob recordset with an SQL source



mud2
11-26-2005, 06:05 PM
Here I go again. Hope springs eternal!
I want to open a recordset, and use an SQL select from as its source.
I get either a syntax error, or not all parameters have been given.
"Select * From Table" , paramater1, parameter2,parameter3 works,
BUT if I try
"Select * from Table where(((condition) = something))", parameter1, parameter2,parameter3
I get either a syntax error, or a message saying I haven't supplied all required parameters.

MikeWolfeJr
11-26-2005, 06:34 PM
Typically, that's
1) a typo in one of your field or table names,
2) a reserved word as a table or field name, or
3) a space in a table or field name,

Usually enclosing table and field names in square brackets
SELECT * FROM [TableName] WHERE [FieldName] = 'MyValue'

If you post the actual code, I'm sure I (or somebody else) can point out the syntax problem.

The other thing I like to do is create the query in the query designer, then switch to SQL view, and copy/paste into your code, replacing static values with variables, etc. Jet has some weird quirks that are totally non-ANSI SQL compliant.