- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
ACADE2018, Win10...
While attempting to use this API to modify an excel spreadsheet (output from BOM report saved as excel):
wd_mdb_ModifyFieldData: it keeps returning "nil" (failure to modify).
I suspect it is my "query" statement... but not sure.
Here's my statement:
(wd_mdb_ModifyFieldData bom_file_hdl cur_tabname (strcat "SELECT * FROM Sheet1$ WHERE USER2 = '" (cdr (nth 1 item))"'") (list
(list "ITEM" (cdr (nth 0 item)));column1
(list "USER2" (substr (cdr (nth 1 item)) 12 nil));column2
(list "QTY" (cdr (nth 2 item)));column3
(list "SUB" (cdr (nth 3 item)));column4
(list "CATALOG" (cdr (nth 4 item)));column5
(list "MFG" (cdr (nth 5 item)));column6
(list "USER3" (cdr (nth 6 item)));column7
(list "DESC" (cdr (nth 7 item)));column8
);end list of lists
);end modify data
Those strcats look like this at run time:
(strcat "SELECT * FROM Sheet1$ WHERE USER2 = '" (cdr (nth 1 item))"'")=
"SELECT * FROM Sheet1$ WHERE USER2 = 'OBSOLETE - 150976'"
(list
(list "ITEM" (cdr (nth 0 item)));column1
(list "USER2" (substr (cdr (nth 1 item)) 12 nil));column2
(list "QTY" (cdr (nth 2 item)));column3
(list "SUB" (cdr (nth 3 item)));column4
(list "CATALOG" (cdr (nth 4 item)));column5
(list "MFG" (cdr (nth 5 item)));column6
(list "USER3" (cdr (nth 6 item)));column7
(list "DESC" (cdr (nth 7 item)));column8
)=
(("ITEM" " 37") ("USER2" "150976") ("QTY" "1") ("SUB" "1") ("CATALOG" "S201U-K3") ("MFG" "ABB") ("USER3" "") ("DESC" "S200 MINIATURE MOLDED CASE CIRCUIT BREAKER, PRO M COMPACT"))
The help for this API says this about the "query" part: Query to specify target record.
But it gives no examples.
I have been poking around and can't seem to figure out what is wrong with the my query statement.
Anyone know how to formulate a valid query for this API?
Solved! Go to Solution.

