以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  SQLReplaceFor中表达式怎么写?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=143664)

--  作者:zhysh
--  发布时间:2019/12/1 9:31:00
--  SQLReplaceFor中表达式怎么写?
甜版好,
Dim cnt As Integer
Dim Str As String ="ttt"
cnt = DataTables("PartInfo").SQLReplaceFor("PartID", "Left(PartID,8)"+ Str, "ParID = 15",True)
MessageBox.Show(cnt)

上面的表达式通不过,不知道问题出在哪里,请教下。
图片点击可在新窗口打开查看此主题相关图片如下:捕获.jpg
图片点击可在新窗口打开查看

--  作者:y2287958
--  发布时间:2019/12/1 13:48:00
--  
"Left(PartID,8)\'"+ Str + "\'"
--  作者:有点蓝
--  发布时间:2019/12/1 20:40:00
--  
cnt = DataTables("PartInfo").SQLReplaceFor("PartID", "Left(PartID,8) + \'" & Str & "\'" , "ParID = 15",True)
--  作者:zhysh
--  发布时间:2019/12/2 14:02:00
--  
谢谢蓝大师,编译通过。
cnt = DataTables("PartInfo").SQLReplaceFor("PartID", "Left(PartID,8) + \'" & Str & "\'" , "ParID = 15",True)