SqlCommand Parameters

I was looking on trying to find some more information on the SQL Command Parameters. Just looking to find the API information so that I use it correctly.

I’ve looked through the Workflow User Guide, and other help resources. Just wasn’t able to find much information on it. Any guidance would be much appreciated.

Are you talking about the DBQuery task? Please give us a little bit more information.

In regards to this post you’ve made before.
You used CreateParameter. Which it seems I can use to help make sure injection doesn’t happen.

The ADO API documentation can be found here: ADO Object Model - ActiveX Data Objects (ADO) | Microsoft Docs

@Phil
Just want to confirm, these methods work in JS as well, correct? I’m running into an Error 0 on line 41, column 1: Microsoft JScript runtime error: Object doesn’t support this property or method.

In the previous article you referred to, my script was written in JavaScript.

What does your line 41 look like?

This is my line 41
var paramDocVersId = sqlCommand.CreateParameter(“docVersId”, 72, 1, 16, docVersId);

Hi @jabreght,

Can you let us know please which version of PlanetPress Workflow you have installed? A option to check this is via the “About…” window which you can access via: PlanetPress Workflow Configuration > Help > About.

Can you also please share the JavaScript code by which you are declaring the variable sqlCommand? Are you for example using the following line of JavaScript code to declare the variable sqlCommand?

var sqlCommand = new ActiveXObject("ADODB.command");

Hey @Marten,

Of course!


Wait, scratch this.
In trying to swap my code over to use the parameter objects, I instantiated a sqlCommand object twice.
Was an error on my part.
I’ll send another message if I run into any more issues while trying to get the parameters working(with a little more double checking done along the way)

So I keep running into this error, which I’ve tried multiple different things for regarding my parameters and the execute statement.

Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC SQL Server Driver]Invalid attribute/option identifier

Which is caused when I run this line.
var recordSet = sqlCommand.Execute();

Now I did see online that it might be related to my odbc driver (I’m using SQL Server and 32-bit) but I’m not sure on this. Any guidance on what might be causing this if known would be greatly appreciated.