Ted Roche wrote:
> SQLSetProp(Handle, 'BatchMode', .F.)
> 
> 

Thanks. It kind of worked.

If I do :
lcStrConn = 'Driver=SQL Server;Server=RA;Database=Prueba'
SQLPrepare(Handle, 'select * from dbo.Paises', 'Paises')
Handle = sqlstringconnect(lcStrConn)
SQLSetProp(Handle, 'Asynchronous', .F.)
SQLSetProp(Handle, 'BatchMode', .F.)
SQLSetProp(Handle, 'DispLogin', 1)
SQLSetProp(Handle, 'DispWarnings', .T.)
SQLSetProp(Handle, 'Transactions', 2)

SQLPrepare(Handle, 'select * from dbo.Paises', 'Paises')
? sqlexec(Handle)

CursorSetProp('Buffering', 5, 'Paises')
CursorSetProp('FetchAsNeeded', .F., 'Paises')
CursorSetProp('MaxRecords', -1, 'Paises')
CursorSetProp('WhereType', 1, 'Paises')
CursorSetProp('SendUpdates', .T., 'Paises')
CursorSetProp('UpdateType', 1, 'Paises')
CursorSetProp('Tables', 'dbo.Paises', 'Paises')
CursorSetProp('KeyFieldList', 'PaisesId', 'Paises')
CursorSetProp('UpdatableFieldList', 'PaisesNombre', 'Paises')
CursorSetProp('UpdateNameList', 'PaisesId dbo.Paises.PaisesId,
PaisesNombre dbo.Paises.PaisesNombre', 'Paises')
-----------
Now I switch to Query Analyzer and :
update paises set PaisesNombre = 'xxxxxxxxArgentina' where PaisesId = 1
-----------
replace PaisesNombre with 'Whatever'
? PaisesNombre
? getfldstate(-1, 'Paises')
? TableUpdate(.T., .F., 'Paises')
------------
And TableUpdate returns .F. (which is correct).
BUT if I don't modify the table before the TableUpdate it keeps
returning .F. (which is incorrect)

Furthermore if I do sqlmoreresults(handle) till it returns 2 :

lcStrConn = 'Driver=SQL Server;Server=RA;Database=Prueba'
SQLPrepare(Handle, 'select * from dbo.Paises', 'Paises')
Handle = sqlstringconnect(lcStrConn)
SQLSetProp(Handle, 'Asynchronous', .F.)
SQLSetProp(Handle, 'BatchMode', .F.)
SQLSetProp(Handle, 'DispLogin', 1)
SQLSetProp(Handle, 'DispWarnings', .T.)
SQLSetProp(Handle, 'Transactions', 2)

SQLPrepare(Handle, 'select * from dbo.Paises', 'Paises')
? sqlexec(Handle)
do while sqlmoreresults(handle) # 2
enddo

CursorSetProp('Buffering', 5, 'Paises')
CursorSetProp('FetchAsNeeded', .F., 'Paises')
CursorSetProp('MaxRecords', -1, 'Paises')
CursorSetProp('WhereType', 1, 'Paises')
CursorSetProp('SendUpdates', .T., 'Paises')
CursorSetProp('UpdateType', 1, 'Paises')
CursorSetProp('Tables', 'dbo.Paises', 'Paises')
CursorSetProp('KeyFieldList', 'PaisesId', 'Paises')
CursorSetProp('UpdatableFieldList', 'PaisesNombre', 'Paises')
CursorSetProp('UpdateNameList', 'PaisesId dbo.Paises.PaisesId,
PaisesNombre dbo.Paises.PaisesNombre', 'Paises')
-----------
Now I switch to Query Analyzer and :
update paises set PaisesNombre = 'xxxxxxxxArgentina' where PaisesId = 1
-----------
replace PaisesNombre with 'Whatever'
? PaisesNombre
? getfldstate(-1, 'Paises')
? TableUpdate(.T., .F., 'Paises')
------------
And TableUpdate returns .T. which is NOT the behavior I was expecting.
The problem is that I HAVE to do the 'sqlmoreresults(handle)' in order
to get the whole set of records.

Any clues?



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to