Error when getting record by security provider

I have a server action with a query that is filtered by the Identity of the security provider. When logged in I get the following error. If I hard code the Identity (it is an int field in an MS SQL database) it works fine. Can someone point me in the right direction to troubleshoot this?

It is classic ASP, with an MS SQL database. Thanks if advance!

  1. {type: “Error”, fileName: “modules/dbconnector.asp”, lineNumber: 46,…}

  2. appData: {}

  3. fileName: “modules/dbconnector.asp”

  4. lineNumber: 46

  5. message: “Application uses a value of the wrong type for the current operation.”

  6. stack: [{fileName: “lib/core/response.asp”, lineNumber: 181, method: “error”,…},…]

  7. type: “Error”

Could I please get some help with this. Although I am new to Wappler, I have done this MANY times in Dreamweaver using the Extensions. Getting a bit frustrated.

Could you send through a few screenshots of your actions that are relative to the error please so we can take a look.

Thanks, here you go. As an FYI, I opened the site in Dreamweaver and recreated the server action and it works. I then opened the site in Wappler and saved the action and it errors out again

In your actual query step instead of choosing ALL with * please rather add every single column to your list. I know it sounds silly but the * has been known to cause issues for some time now.

Did not work. I even did a clean install with only the login. Same issue. On another note, If I enter the value in instead of using the identity value it works fine. Any other ideas?

The only thing i can even think of is that the field type seems to be what the error was all about.

This may or may not work but its worth a try, and I can not see why it should not already work
In your query where you have {{security.identity}} try add {{security.identity.toNumber()}} and if that does not work try {{security.identity.toString()}} and lets just see.

2 Likes

Just one other thought and to be very very honest I am not sure if it will make any difference at all. But whenever I have done the same thing as you I also have a security restrict step after the Security Provider step.

So here are some screenshots of a similar Action set to yours, although I am using PHP and MySQL so if it is something specific to do with ASP as to the error then it may not work the same as mine. Unfortunately I am under the impression that probably 90% of the users here in the community are using PHP / MySQL so getting assistance on anything other than that is probably going to be a little more specific to the core Wappler Team.

Thanks again for your input, I had already tried converting to a number, but not string, that did not work either. I had a security restrict in there initially but took it out to remove as many components as possible. I set up the same scenario in dreamweaver with the exact same configuration to the same database and it worked flawlessly. Today I am going to do a file compare and see what is different… I seem to be one of the only people left using classic ASP and I’m starting to think it might be a bug in Wappler. I have setup this configuration in at least 10 sites using DW and it is a solid configuration. Thanks again for your recommendations.

1 Like

@PSWeb, thanks for your recommendation. I started with a new project again, just to make sure there were no other variables. I was able to get it to work by converting the indentityto a string. Not sure why as it is an integer, but I’ll take it as a win for now so I can move on. Loving Wappler, anxious to really take it for a drive now.

haha, well I am just happy you got something to work for the time being, I am pretty sure it must be something simple that once the Christmas and New Years is over, then the Wappler team will have it fixed quite quickly.
Once you fully dive into Wappler, you will not be sorry, it really is a wonderful application.

1 Like