Skip to content
Advertisement

Excel SQL VBA: adding more than one cmd parameter

I am writing SQL-query, and I get error with string value:

I tried to add more than one cmd parameter to solve this problem:

But I also get an error. How do I set more than one cmd parameter and use it in my query?

Table I am working with: here.

Advertisement

Answer

The parameter to CreateParameter are

The Direction – parameter should be adParamInput (that is a 1) for all parameters

My experience is that for a string parameter (adChar), you need to provide the size (length of the string).

Try

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement