@variable parameter

M

muyBN

Does anyone know if it's possible, when inserting values into a database like
I'm showing below, to use the "@variable" form? This is something I've done
with ASP but not sure if it can be done in VBA; or if I'm just not handling
it correctly.

strSQL = "INSERT INTO [TableName] (CO, JOB) VALUES(@CO,@JOB)"

I received errors while trying to define the parameters as shown below. The
error came from the first parenthesis in the first line.

cmdInsert = New adodb.Command( strsql, csconn)
cmdInsert.Parameters.Add( new SqlParameter( "@CO", CO)
cmdInsert.Parameters.Add( new SqlParameter( "@JOB", JOB)

Could it be that there is a VB reference I need to add, or am I missing some
other concept?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top