
我有一个MS Access 2007表:
列是DB,Module,CommentID和Comment
我有一个SQL查询,它返回MS Access Query Design中的正确记录.
我在立即窗口中确认了Ms Access Query Design和VBA模块"Module1"中的sql是相同的.
我把这个函数称为如下:
?LookupComment(currentproject.Name,Application.VBE.ActiveCodePane.CodeModule,"1")
Run Code Online (Sandbox Code Playgroud)
随后在函数中的strSQL在立即窗口中确认为
Select * from tblComments where DB='db1.accdb' AND Module='Module1' AND CommentID='1'
Run Code Online (Sandbox Code Playgroud)
如果我用"tblComments"替换"strSQ",函数返回正常.
但我在使用strSQL的rst.open上遇到错误
方法'打开'对象'_Recordset'失败
Public Function LookupComment(theDB, theModule, theCommentID As String) As String
Dim cn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim strSQL As String
Set cn = CurrentProject.Connection
Set rst = New ADODB.Recordset
strSQL = "Select * from tblComments where DB='" & theDB & "' AND " _
& "Module='" & theModule & "' AND …Run Code Online (Sandbox Code Playgroud) 伙计们,
我有这个数组:
var list = new Array('Archer','Archer','Banker','Lantern','Toryboy','The Barb','Tim
Whiffler','Glencoe','Warrior','Nimblefoot','The Pearl','The Quack','Don
Juan','Haricot','Wollomai','Briseis','Chester','Calamia','Darriwell','Grand
Flaneur','Zulu','The Assyrian','Martini-Henry','Malua','Sheet
Anchor','Arsenal','Dunlop','Mentor','Bravo','Carbine','Malvolio','Glenloth','Tarcoola','Pat
ron','Auraria','Newhaven','Gaulus','The Grafter','Merriwee','Clean
Sweep','Revenue','The Victory','Lord Cardigan','Acrasia','Blue
Spec','Poseidon','Apologue','Lord Nolan','Prince Foote','Comedy King','The
Parisian','Piastre','Posinatus','Kingsburgh','Patrobas','Sasanof','Westcourt','Night
Watch','Artilleryman','Poitrel','Sister Olive','King
Ingoda','Bitalli','Backwood','Windbag','Spearfelt','Trivalve','Statesman','Nightmarch','Pha
r Lap','White Nose','Peter Pan','Hall Mark','Peter Pan','Marabou','Wotan','The
Trump','Catalogue','Rivette','Old Rowley','Skipton','Colonus','Dark
Felt','Sirius','Rainbird','Russia','Hiraji','Rimfire','Foxzami','Comic
Court','Delta','Dalray','Wodalla','Rising Fast','Toparoa','Evening Peal','Straight
Draw','Baystone','Macdougal','Hi Jinx','Lord Fury','Even Stevens','Gatum Gatum','Polo
Prince','Light Fingers','Galilee','Red Handed','Rain Lover','Rain Lover','Baghdad
Note','Silver Knight','Piping Lane','Gala Supreme','Think Big','Think Big','Van der
Hum','Gold and Black','Arwon','Hyperno','Beldale Ball','Just A Dash','Gurner's
Lane','Kiwi','Black Knight','What A Nuisance','At Talaq','Kensei','Empire
Rose','Tawrrific','Kingston Rule','Lets Elope','Subzero','Vintage
Crop','Jeune','Doriemus','Saintly','Might and Power','Jezabeel','Rogan
Josh','Brew','Ethereal','Media Puzzle','Makybe Diva','Makybe Diva','Makybe
Diva','Delta Blues','Efficient','Viewed','Shocking','Americain'); …Run Code Online (Sandbox Code Playgroud)