<p>I'm a bit confused here.  Microsoft as far as I can tell claims that parametrization is the best way to protect your database from SQL injection attacks.  But I find two conflicting sources of information here:</p>

<p><a href="http://support.microsoft.com/kb/200190" rel="nofollow noreferrer">This page</a> says to use the ADO command object.  But <a href="http://msdn.microsoft.com/en-us/library/ms679836(VS.85).aspx" rel="nofollow noreferrer">this page</a> says that the command object isn't safe for scripting.  I seem to recall reading somewhere that the command object shouldn't be used in VBScript or JScript because of security vulnerabilities, but I can't seem to find that article.</p>

<p>Am I missing something here, or do those two articles seem to contradict each other?</p>

[{'answer_id': 57693, 'author': 'Michael Pryor', 'author_id': 245, 'author_profile': 'https://Stackoverflow.com/users/245', 'pm_score': 3, 'selected': True, 'text': '<p>I could be wrong here, but I think this just means that someone could use the Command object to do bad things.  I.e. it\'s not to be trusted if someone else is scripting it.</p>\n\n<p>See <a href="http://www.avdf.com/mar97/art_interface.html" rel="nofollow noreferrer">safe for scripting</a> in this article.  Every instance that talks about this phrase online, references it as if you are marking an ActiveX control saying "This control does no I/O or only talks back to the server that it came from" but the Command object doesn\'t do that.  It can be used to do a lot of things which could be unsafe.</p>\n\n<p>The "safe" they are talking about and the "safe" to prevent from SQL injection are two different things.  The article about using the ADO Command object to parametrize your data is spot on.  You should do that.</p>\n\n<p>And, Microsoft further confirms this here:</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/ms676585(v=VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms676585(v=VS.85).aspx</a></p>\n'}, {'answer_id': 57700, 'author': 'rpetrich', 'author_id': 4007, 'author_profile': 'https://Stackoverflow.com/users/4007', 'pm_score': 1, 'selected': False, 'text': '<p>I think "safe for scripting" means "safe to be run from a webpage we just retrieved from some Nigerian prince".  The command object should be safe to run on the server.</p>\n\n<p>At work though, back in the day my colleagues didn\'t trust it so we had an in-house framework that basically did the same thing.</p>\n'}]
['https://Stackoverflow.com/questions/57528', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2147/']