nuintun/node-adodb

Error : Unable to transcode Buffer

Leti opened this issue · 6 comments

Leti commented

Hello,
I am trying to get all columns of a table.
I did this query :

connexion2
            .query('SELECT top 1 * FROM '+tableName)
            .then(data => {
                
               for(var key in data[0])
                    {
                            console.log(key);
                    }
                
            })
        .catch(error => {
            console.error(error);
        });   

But I get this error :

Uncaught Error: Unable to transcode Buffer [U_INVALID_CHAR_FOUND] at spawn.js :124

I found that it occurs only when I have a Ole object in my table (it works fine with other tables)
I don't want to get the image, I just need the column name. How can I achieve that?

Thank you very much.

node version ?

Leti commented

It's v10.15.0

Check you data does it contain U_INVALID_CHAR, this error cause by buffer.transcode

Leti commented

My data is an image, it's a binary data, so I think that is why it can't be read.

In fact I don't need to get that data, I just need the names of the columns, and my way was to select the first row of the table. Do you know any better way to get the columns names?

Thank you very much for your help.

I'm having this same issue in retrieving a field with BLOB data. I receive this error:

Error: Unable to transcode Buffer [U_INVALID_CHAR_FOUND] at transcode (internal/buffer.js:27:15) at ChildProcess.child.on.exitCode (F:\fst\lxr-converter\node_modules\node-adodb\lib\spawn.js:124:22) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:915:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

I'm running Node v8.15.0.

In my case, I really do need this data, as I'm exporting it into another database. Any suggestions? Thanks!

Leti commented

Hello
For my problem I solved it using .schema(4) instead of query which retrieves the columns names.
I'm so sorry aaronbean because I don't have a solution for this problem. Good Luck...