|
-
May 31st, 2006, 12:56 PM
#16
Frenzied Member
Re: [RESOLVED] SQL INSERT error
 Originally Posted by leinad31
Yes, and its interpreted as placeholders for parameters... the values of which are provided by the parameters collection of the command object.
VB Code:
objCommand.Parameters.Add objCommand.CreateParameter("title",advarchar,50, [b]txtTitle.Text[/b])
objCommand.Parameters.Add objCommand.CreateParameter("actor",advarchar,50, [b]txtactor.Text[/b])
objCommand.Parameters.Add objCommand.CreateParameter("producer",advarchar,50, [b]txtproducer.Text[/b])
objCommand.Parameters.Add objCommand.CreateParameter("comment",advarchar,50, [b]txtComment.Text[/b])
The replacement/update of the values is done by FIFO (first parameter object provides data for the first ?)
After all parameters have values then the query executes without an error.
Ok...cool. I think I'm actually starting to get this (and like it )
So, I would use advarchar for text. What would I use to insert values into a int field?
Also, is this something that is confined to INSERTS or would I do the same thing with UPDATES?
Beantown Boy
Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|