你用的内部表吧? 内部表的sql语法和access相同,你看看有些什么函数可以用:
http://www.foxtable.com/help/topics/0692.htm
显然没有SubString,而且动态合成表达时你也有问题,建议看看:
http://www.foxtable.com/help/topics/1284.htm
Dim txt As String = e.Form.Controls("kemudaima").Text
Dim cnt As Integer= txt.Length
cmd.CommandText = "Select Count(*) From {科目表} Where Mid(科目代码,1, "& cnt & ") = '" & txt & "'"
If cmd.ExecuteScalar > 0 Then
Messagebox.show("删除科目失败,请先删除此科目的下级科目!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
[此贴子已经被作者于2013-6-4 12:57:06编辑过]