Reference this thread from yesterday.
I'm trying to write my first parametized INSERT query. I have an ADODB.Command oject defined as cn. However, I'm getting no intellisense listings for ComandText or Parameters, etc. A snippet of the code from the referenced thread isAlthough I can't find where objCommand is declared in that thread, I assumed it was as ADODB.Connection. If not, then what is it? What do I need for the .Parameters.Add and .CommandType, etc?VB Code:
sSQL = "INSERT INTO movieInfo (title, actor, producer, comment) VALUES (?,?,?,?) objCommand.CommandText = sSQL objCommand.CommandType = adCommandText objCommand.Parameters.Add objCommand.CreateParameter("title",advarchar,50, txtTitle.Text) objCommand.Parameters.Add objCommand.CreateParameter("actor",advarchar,50, txtactor.Text) objCommand.Parameters.Add objCommand.CreateParameter("producer",advarchar,50, txtproducer.Text) objCommand.Parameters.Add objCommand.CreateParameter("comment",advarchar,50, txtComment.Text) objCommand.Execute




Reply With Quote