Ok. I want to use parameterized queries to avoid dealing with embedded double or single quotes (" or ') in my data.
As a simple example, what would the VBA code look like for the parameterized verion of this?
Dim qstr as String
Dim possiblyDangerousString as String
qstr = "SELECT MyTable.LastName from MyTable WHERE MyTable.LastName = '" & possiblyDangerousString & "';"
I did not cut and paste this from my code (on a different box right now), so there might be a typo.
Once I figure out this simple example, I need to move on to more complex statements (multiple parameters and joins).
Thanks for any advice
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…