Figured out how to do this by looking at other comments in this newsgroup. Posting the answer for anyone else who would like to know:
sqlString = _ "UPDATE WTMData SET WTMData.HALOT = " & sHALOTDef & ", " & _ "WTMData.BDB = " & sBDBDef & ", WTMData.AlternateGloss = " & sAltDef & ", " & _ "WTMData.GlosserInitials = ""apb"", WTMData.GlossDate = Date() & "" "" & Time() " & _ "WHERE (((WTMData.HALOT) Is Null) AND ((WTMData.BDB) Is Null) AND " & _ "((WTMData.AlternateGloss) Is Null) AND ((WTMData.GlosserInitials) Is Null) AND " & _ "((WTMData.GlossDate) Is Null) AND ((WTMData.Parsing) Is Null) AND " & _ "((WTMData.Lemma)=" & sLemma & ") AND ((WTMData.WTMOccurrences)<100) AND " & _ "((WTMData.WTMParsing) Not Like ""np*"") AND ((WTMData.[H/A])=""H""));"
Set dbs = OpenDatabase("C:\mydatabase.mdb") With dbs .Execute sqlString, dbFailOnError .Close End With Set dbs = Nothing
Merry Christmas! Philip Brown
"Philip Brown" wrote:
[Quoted Text] > Hello, > > I want to run the following update query in Excel: > > UPDATE WTMData SET WTMData.HALOT = "myvariable", WTMData.BDB = "myvariable", > WTMData.AlternateGloss = "myvariable", WTMData.GlosserInitials = "apb", > WTMData.GlossDate = Date() & " " & Time(), WTMData.Parsing = "myvariable" > WHERE (((WTMData.HALOT) Is Null) AND ((WTMData.BDB) Is Null) AND > ((WTMData.AlternateGloss) Is Null) AND ((WTMData.GlosserInitials) Is Null) > AND ((WTMData.GlossDate) Is Null) AND ((WTMData.Parsing)="myvariable") AND > ((WTMData.Lemma)="myvariable") AND ((WTMData.WTMOccurrences)<100) AND > ((WTMData.WTMParsing) Not Like "myvariable" And (WTMData.WTMParsing) Like > "myvariable") AND ((WTMData.[H/A])="myvariable")); > > How would I run it from within Excel? > Thanks!
|