Thursday, 8 March 2012

Conncetiviti error

I have this error only when reading a certain file from SQL
server, and not with all the other files, so it's very strange.
I have a Visual FoxPro cursoradapter who gets populated with a
record from a table in SQL server, and the CursorFill method of
the CursorAdapter (which populates it using the CursorAdapter
properties) raises this error:
Connectivity error: [ODBS SQL Server driver] [SQL Server] Line 1:
incorrect sintax near ")".
The message was in italian so I translated it.
I checked the CursorAdapter's SelList, the SelectCmd, the
KeyFieldList, the Cursorschema... none of them contains
parentheses except the selectcmd, as modified in the
BeforeCursorfill event. The selectcmd is the command that Visual
FoxPro will internally use to call SQL server and populate the
cursoradapter.
This select statement contains the list of fields, the FROM
clause and the following "WHERE" condition:
WHERE FLG_LOAD=0 and (substring(TAG1,1,16) >= ' '
and substring(TAG1,1,16)<=(SELECT
COALESCE(min(substring(TAG1,1,16)),'') FROM AR_ANAGR_ANA_IP WHERE
substring(TAG1,1,16) > ' ' and FLG_LOAD = .F.))
FLO_LOAD and TAG1 are both fields of that table.
Someone sees something strange, in that condition?
TIA
VilliHi
FLG_LOAD = .F.))
The ".F." is not a valid expression in SQL Server. Is it a variable, a value
or ?
Regards
Mike
"Villi Bernaroli" wrote:

> I have this error only when reading a certain file from SQL
> server, and not with all the other files, so it's very strange.
> I have a Visual FoxPro cursoradapter who gets populated with a
> record from a table in SQL server, and the CursorFill method of
> the CursorAdapter (which populates it using the CursorAdapter
> properties) raises this error:
> Connectivity error: [ODBS SQL Server driver] [SQL Server] Line 1:
> incorrect sintax near ")".
> The message was in italian so I translated it.
> I checked the CursorAdapter's SelList, the SelectCmd, the
> KeyFieldList, the Cursorschema... none of them contains
> parentheses except the selectcmd, as modified in the
> BeforeCursorfill event. The selectcmd is the command that Visual
> FoxPro will internally use to call SQL server and populate the
> cursoradapter.
> This select statement contains the list of fields, the FROM
> clause and the following "WHERE" condition:
> WHERE FLG_LOAD=0 and (substring(TAG1,1,16) >= ' '
> and substring(TAG1,1,16)<=(SELECT
> COALESCE(min(substring(TAG1,1,16)),'') FROM AR_ANAGR_ANA_IP WHERE
> substring(TAG1,1,16) > ' ' and FLG_LOAD = .F.))
> FLO_LOAD and TAG1 are both fields of that table.
> Someone sees something strange, in that condition?
> TIA
> Villi
>
>|||Mi e' parso che Mike Epprecht (SQL MVP) abbia scritto:

> Hi
> FLG_LOAD = .F.))
> The ".F." is not a valid expression in SQL Server. Is it
> a variable, a value or ?
Ooooooooooooooops!
Thanks, Mike :)
--
The answer to the ethernal question is:
put a read events after the launch of the form

No comments:

Post a Comment