Page 1 of 1
DCBROWSE ... EDIT DOES NOT WORK WITH SQLEXPRESS
Posted: Tue Jan 28, 2020 1:23 pm
by unixkd
Dear Roger/All
DCBROWSE ... EDIT DOES NOT WORK WITH SQLEXPRESS.
See below.

- DCBROWSE-EDIT-ERROR.png (55.87 KiB) Viewed 13563 times
Re: DCBROWSE ... EDIT DOES NOT WORK WITH SQLEXPRESS
Posted: Tue Jan 28, 2020 4:34 pm
by rdonnay
Cell editing was never tested with SQLEXPRESS.
Try putting a code block in the DEFAULT clause.
What build of eXpress++ are you using?
Re: DCBROWSE ... EDIT DOES NOT WORK WITH SQLEXPRESS
Posted: Tue Jan 28, 2020 9:15 pm
by unixkd
Version build 261
Re: DCBROWSE ... EDIT DOES NOT WORK WITH SQLEXPRESS
Posted: Tue Feb 11, 2020 2:26 am
by unixkd
Anybody with the idea to make DCBROWSE ... EDIT WORK WITH SQLEXPRESS
Joe
Re: DCBROWSE ... EDIT DOES NOT WORK WITH SQLEXPRESS
Posted: Thu Feb 20, 2020 10:36 pm
by unixkd
Now I got it working perfectly
Thanks ALL
Joe
Re: DCBROWSE ... EDIT DOES NOT WORK WITH SQLEXPRESS
Posted: Sat Feb 22, 2020 7:41 am
by rdonnay
We share our solutions with you.
How about sharing your solution with us?
Re: DCBROWSE ... EDIT DOES NOT WORK WITH SQLEXPRESS
Posted: Sat Feb 22, 2020 8:22 pm
by unixkd
OK.
1. I use SQLdataset instead of SQLSelect
2. I have
FUNCTION SQLGetSetBlock( oCursor, nField , lCommit)
Local bPutData := {|o,x,lSave|o:fieldPut(nField,IF(ValType(x)=="C",Trim(x),x) ), IF(lSave,o:Commit(),Nil)}
Local oCol, nLen, nDec, xRet
DEFAULT lCommit := .t.
oCol := oCursor:getSQLColumn(nField)
nLen := oCol:length
IF oCol:ValType == "C"
xRet := {|x|if(x==NIL,PadR(oCursor:fieldGet(nField),nLen), Eval(bPutData,oCursor,x,lCommit))}
ELSE
xRet := {|x|if(x==NIL,oCursor:fieldGet(nField), Eval(bPutData,oCursor,x,lCommit))}
ENDIF
RETURN xRet
One More Problem: I discover that DCBROWSECOL ... EDITOR is not saving to table e.g.
DCBROWSECOL DATA SQLGetSetBlock(oCursor, "SellingPrice") HEADER "Selling Price" WIDTH 17 EVAL {|o|o:ColorBlock := bColor} EDITOR "SELLING_PRICE" PICTURE AMT_PIC EDITPROTECT {||!oCursor:FieldGet("AllowPost")}
@ Nil,Nil DCGET xNIL PICTURE AMT_PIC POPUP {|n| DC_PopCalc(n)} GETFONT "8.Courier.Bold.Italic" GETID "SELLING_PRICE"