有一資料庫XXX.MDB內有a,b,c,d,e,f,g..等資料表.
如何用變數達成資料表選用,例如:
rs.Open "Select * from a where Time between " + Chr(35) + Str(DTP1.Value) + Chr(35) + " And " + Chr(35) + Str(DTP2.Value) + Chr(35), Cnn, adOpenDynamic, adLockOptimistic
架設我的變數是TT,我把語法改為如下,但無法執行...
dim tt as string
TT=a
rs.Open "Select * from TT where Time between " + Chr(35) + Str(DTP1.Value) + Chr(35) + " And " + Chr(35) + Str(DTP2.Value) + Chr(35), Cnn, adOpenDynamic, adLockOptimistic