आपके दूसरे स्निपेट में कोड सही है, लेकिन इसे एक नए ADODB.Command पर लागू किया जाना चाहिए ऑब्जेक्ट, Connection . के लिए नहीं वस्तु:
username = Trim(Request("username"))
'-----Added this-----
Dim cmdContent
Set cmdContent = Server.CreateObject("ADODB.Command")
' Use this line to associate the Command with your previously opened connection
Set cmdContent.ActiveConnection = connContent
'--------------------
cmdContent.Prepared = True
Const ad_nVarChar = 202
Const ad_ParamInput = 1
SQL = " SELECT * FROM users WHERE (username=?) ; "
Set newParameter = cmdContent.CreateParameter("@username", ad_nVarChar, ad_ParamInput, 20, username)
cmdContent.Parameters.Append newParameter
cmdContent.CommandText = SQL
Set rs = cmdContent.Execute
If NOT rs.EOF Then
' Do something...
End If
rs.Close
वैसे, adParamInput . की वर्तनी के साथ एक टाइपो था ad_ParamInput . के बजाय (मेरे उदाहरण में सही किया गया)।