The specified SQLSetStmtOption Option '5' is not compatible with this system

Hey there fellow coders! I've been facing an issue while trying to make a database query using the odbc package found at https://www.npmjs.com/package/odbc. Interestingly, I can successfully run queries using FlySpeed SQL Query. However, when attempting to query through the package, I encounter the following error:

[Error: [odbc] Error preparing for fetch] {
    odbcErrors: [
        {
            state: 'HYC00',
            code: 0,
            message: "[Transoft][TSODBC][usqlsd]SQLSetStmtOption Option '5' is not supported "
        }
    ]
}

Below is the snippet of my controller (From an adonisjs v4 API):

"use strict";

const odbc = require("odbc");

class OdbcController {
    async fetchData() {
        odbc.connect('DSN=triad.udd;', (error, connection) => {
            if (error) {
                console.log(error)
            }
            let sql = "Select Customer From m.POS_ARC_D_HEAD;"
            connection.query(sql, (error, result) => {
                if (error) {
                    console.log(error)
                }
                console.log('result', result)  
            })
        });
    }
}

module.exports = OdbcController;

I have managed to establish a connection to the database. Interestingly, when I purposely misspell the table name, it correctly informs me that the table does not exist. However, upon querying an existing table, I receive the aforementioned error as well as this additional error (my application crashes after about 3 seconds with this log message):

/c/Program Files (x86)/nodejs/npm: line 44: 1226 Segmentation fault "$NODE_EXE" "$NPM_CLI_JS" "$@"

You can find the documentation for the odbc driver here (I believe):

If anyone has any insights on how to resolve this issue, I would greatly appreciate your help. Thank you in advance!

Note that both the Transoft ODBC Driver and my Node.js are in 32-bit versions to prevent compatibility issues.

Answer №1

In case someone encounters this problem, I found a solution by reverting from version 2.4.6 to 2.2.0 of the odbc package. It resolved the issue for me, although I did not experiment with different versions. The root cause of the error remains unknown.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can you provide the proper syntax for the Jquery done() function?

I'm currently dealing with the code below: However, I encountered an error on line 6: Uncaught SyntaxError: Unexpected token { Even after reviewing the documentation for the done() function, I'm unable to identify my mistake here. ...

Arranging elements in an array based on two different properties

Trying to organize an array of elements (orders details). https://i.stack.imgur.com/T2DQe.png [{"id":"myid","base":{"brands":["KI", "SA"],"country":"BG","status":&qu ...

What is the best way to access and iterate through JSON data?

I am trying to extract data from my Json file, however, I cannot use a specific 'key' because it changes on a daily basis. https://i.sstatic.net/sZySk.png My attempted solution is as follows: template: function(params) { const objects ...

What is the best way to access a value within a JSON object in a React render method?

Overview I am currently working on creating a blog using React and JSON data. Upon checking this.state.blogs, I am getting the output of: [object Object],[object Object],[object Object]. I have attempted to use the .map function but I am not sure how to ...

Using AngularJS ui-router to implement Bootstrap UI tabs

Having trouble with Bootstrap UI Tabs in AngularJS ui-router. Trying to add an active class when refreshing the page. Passing the tab's URL to the asActive(url) function in my controller to compare with the current URL of the page. Using the "active" ...

Text field in React's material-ui causes the screen to shake

I am encountering an issue with a simple React code that includes a Material-UI Textfield. Whenever I try to enter data into the text field, the screen shakes. Additionally, when I click outside of the box after entering data, the screen shakes again. Ca ...

I'm puzzled as to why a div tag suddenly becomes invisible when I attempt to link it with a v-for directive in my code

I am facing an issue with the div tag assigned to the log class. My objective is to populate the text using data retrieved from the API response. However, when I attempt to include the v-for directive, the entire div mysteriously disappears from the brow ...

Tips for extracting a specific segment from a URL string

Take a look at the outcome of the console.log below: console.log('subscribe:', event.url); "https://hooks.stripe.com/adapter/ideal/redirect/complete/src_1E2lmZHazFCzVZTmhYOsoZbg/src_client_secret_EVnN8bitF0wDIe6XGcZTThYZ?success=true" I need to ...

Narrow down an array of objects by matching a specific property and value to a separate array of objects

I am facing a challenge with two sets of arrays - one for the headers (columns) of a table and the other for the rows. const headers = [ { text: 'Dessert (100g serving)', align: 'left', sortable: false, value: 'n ...

Store the active tab in AngularJS with Bootstrap to easily remember and display

After creating a basic AngularJS application with the Bootstrap directive, I noticed that some of my pages have tabs. The issue arises when I am on a tab other than the first one and click a link to navigate to another view. Upon returning (using either th ...

What is the best way to retrieve the parameters from the current URL within an Express function on the backend? (details below)

Struggling to articulate my issue here. I'm in the process of creating a straightforward express app that utilizes the omdb API to search for movie titles and display the results. The challenge is that the omdb API returns the results in pages, with 1 ...

Share a URL and display small previews from it - php

Have you ever noticed that on certain websites, such as Facebook, when you post a link it automatically displays thumbnails from the linked website? Like in the image below: Ever wondered how to achieve that effect? ...

Is there a way to modify the color scheme of my webpage while utilizing Bootstrap?

As I delve into programming with Bootstrap, I encountered an issue while attempting to change the background color of my body. Even though I used the following CSS code: body { background-color: #eba; width: 100%; height: 100%; } The color change ...

The autocomplete feature in React is not displaying properly due to a problem with rendering

I am currently working on creating an autocomplete/autosuggest search bar using the Material-UI library with data fetched from an API. Below is a step-by-step breakdown of the code implementation. We first define the options for the autosuggest search bar ...

React Router isn't displaying any content

I'm facing an issue with react-router-dom where none of my components are rendering and I just see a blank white screen. The content is not being added to my index.html template, even though there are no visible errors. Interestingly, it mentions that ...

Creating a series of promises in a structured chain

How can the code structure be improved, especially regarding exception handling within a "promise chain"? $("#save").click(function(e) { e.preventDefault(); let $self = $(this); let profile = {} $self.prop("disabled" ...

"Use Highcharts to visually compare the data from one month in two different years

How can I use Highcharts Columns to compare data from two different years within the same month? Check out the example image below: https://i.sstatic.net/8MMsA.png The data structure is as follows: myData[0] = { data1:"0.00", data2:"0.00", data3:"868.0 ...

Developing play and pause capabilities using JavaScript for the existing audio player

Currently, I am developing a Chrome extension that includes an HTML popup with buttons to play audio files. However, I feel that my current approach is not the most efficient and I am struggling to find ways to simplify the process. The method I am using n ...

What are some ways to condense this Angular/TS code for improved performance and readability?

I am in need of assistance with refactoring a method called getBaseUrl(). This method assigns a specified string value to this.baseURL based on the input serviceType. getBaseUrl(serviceType: string, network?: string) { // Method logic to determine base ...

Tips on retrieving the text content of an HTML element using its tag

Is there a way to retrieve the selected text along with its HTML tags using window.getSelection()? When using window.getSelection(), it only returns plain text such as HELLO. However, I need the text with the HTML tag included, like this <b>Hello< ...