Hello Michael,
I would do
IF lAddMode
cSqlStatement = "SELECT EMP.* FROM EMP WHERE .F."
ELSE
cSqlStatement = "SELECT EMP.* FROM main_one!EMP WHERE EMP.pers_no = ?nEmplNo "
ENDIF
This should be somewhat faster when you add records.
You could also create it from the local cursor if it's available!
Bob
>Hi Bob,
>
>cSqlStatement = "SELECT EMP.* FROM main_one!EMP WHERE EMP.pers_no = ?nEmplNo "
>
>IF lAddMode
> cSqlStatement = cSqlStatement + "AND .F. "
>ENDIF
>
>nHandle = sqlexec(nConHandle, csqlstatement, 'empl_cursor')
>
>That actually worked. I would have assumed that that would crash my SQL statement.
>
>Thanks alot
>Mike
'If the people lead, the leaders will follow'
'War does not determine who is RIGHT, just who is LEFT'