Option ExplicitPrivate Sub Form_Load() Dim strSQL As String Dim str(9) As String Dim tname As String str(1) = "1" tname = " qj" strSQL = "select * from" & tname & " where dm='" & Trim(str(1)) & "'"End Sub ---------- www.vicmiao.com 努力就有美好时光!
'多加几个空格试试 select * from " & tname & " where dm='" & Trim(Str(i)) & "'
Dim strSQL As String
Dim str(9) As String
Dim tname As String
str(1) = "1"
tname = " qj"
strSQL = "select * from" & tname & " where dm='" & Trim(str(1)) & "'"End Sub
----------
www.vicmiao.com
努力就有美好时光!
select * from " & tname & " where dm='" & Trim(Str(i)) & "'