我試圖從VB調用Access中的查詢,但我有一些問題。代碼如下:從VB調用查詢
Dim myQuery As QueryDefs
myQuery("2012Patient_q").Execute
但是這不起作用。我嘗試使用Google搜索,但無濟於事。我在這裏錯過了什麼?
感謝
我試圖從VB調用Access中的查詢,但我有一些問題。代碼如下:從VB調用查詢
Dim myQuery As QueryDefs
myQuery("2012Patient_q").Execute
但是這不起作用。我嘗試使用Google搜索,但無濟於事。我在這裏錯過了什麼?
感謝
的代碼也許應該這樣寫:
Dim myQuery As QueryDef ' no "s"
Set myQuery = CurrentDB.QueryDefs("2012Patient_q")
myQuery.Execute
或者,簡單地說,沒有任何中間變量:
CurrentDB.QueryDefs("2012Patient_q").Execute
Visual Basic應用程序 – Katana24