这样更简单:
Private Sub Command1_Click()
On Error Resume Next
MsgBox Split("isnull(@qtyField10am1,0) as 'Qty10am1',isnull(@qtyField11am1,0) ", "as")(1)
End Sub
dim p as integer
dim x as string
dim strFound as string
x = "isnull(@qtyField10am1,0) as 'Qty10am1',isnull(@qtyField11am1,0)"
p = instr(1, x,"as")
if p then
strFound = mid(x, p + 1)
p = instr(1, strFound, "'")
strFound = mid(strFound, p + 1)
p = instr(1, strFound, "'")
strfound = left(strFound, p - 1)
else
strFound = ""
end if