Classic ASP and MS SQL open a query in the server connect editor I get an error

OS info

  • Operating System : Windows 10.0.19045
  • Wappler Version : 5.2.5

Problem description

When I try to open a query in the server connect editor I get an error.

Steps to reproduce

  1. open a query that already exists then you get the error

If you add a new query to a server connect/app flow it seems to work correctly. And add the correct code correctly I believe, but once you close it it won’t open back up. You have to create it from scratch again.

Here is the log file:
report1669681095679.zip (71.8 KB)

Could specify what server model and database are you using and also include the generated server action json file so we can inspect it?

Could you send the generated server action with the query that is giving you the error and not the database connection?

georgeTest.zip (663 Bytes)

I create this simple database query. it opens up in the query builder the first time. But if I try to open it again, I get the error. This was a brand new server action.

1 Like

In your connection file, add "databaseType": "SQL_Server", to the options.

<script runat="server" language="jscript">
// Database Type : "SQL_Server"
// Database Adapter : "mssql"
module.exports = //<<<'JSON'
{
    "name": "HitekFab",
    "module": "dbconnector",
    "action": "connect",
    "options": {
        "server": "mssql",
        "databaseType": "SQL_Server",
        "connectionString": "Provider=SQLNCLI11;Data Source={{$_ENV.DBFab_Host}};Initial Catalog={{$_ENV.DBFab_Database}};User ID={{$_ENV.DBFab_User}};Password={{$_ENV.DBFab_Password}};Network Library=DBMSSOCN",
        "meta"  : false
    }
}
//JSON
;
</script>

No luck. Didn’t change anything. This project has two mssql databases and the other one was already set like this and its doing the same thing.

Does it work when you don’t use environment variables?

No it does not

Do you have the direct connection setup in the database manager?

Yes. Everything worked perfect until this last update. the previous update it didn’t work with experimental features turned on, but did when they were turned off.

Does it only happen with existing server actions or do you also get the error when creating a new one. I’m trying to reproduce the error but don’t get it.

The action file you’ve posted still contains the old format, yours has:

{
          "type": "SELECT",
          "columns": [
            {
              "table": "dbo.faqs",
              "column": "*"
            }
          ],
          "params": [],
          "table": {
            "name": "dbo.faqs"
          },
          "primary": "OrderDetailsID",
          "joins": [],
          "query": "SELECT *\nFROM [dbo.faqs]"
        }
      }

new format is:

{
          "type": "SELECT",
          "columns": [
            {
              "table": "faqs",
              "column": "*",
              "schema": "dbo"
            }
          ],
          "params": [],
          "table": {
            "name": "faqs",
            "schema": "dbo"
          },
          "primary": "faq_id",
          "joins": [],
          "query": "SELECT *\nFROM [dbo.faqs]"
        }
      }

The test file that I sent was created new for the test. As to get rid of any chance of old code causing issues.

should I maybe uninstall and reinstall from fresh?

I just created this one new from scratch.

PatrickTest.zip (650 Bytes)

Try to reinstall Wappler, it seems to generate the action in an old way so it is possible that Wappler was not correctly updated and still using some old files.

roger that. I’ll do that and get back to you in just a bit.

ok, I reinstalled to 5.2.6. did the full uninstall. deleted everthing in the user/baub/appdata/roaming/wappler except the /configuration folder and then reinstalled.

Looks like its still doing the same thing. I recreated the same server connect
patrickTest2.zip (652 Bytes)

Should I try to reinstall again, and delete the /configuration folder too this time?