node-adodb icon indicating copy to clipboard operation
node-adodb copied to clipboard

Error : Unable to transcode Buffer

Open Leti opened this issue 6 years ago • 6 comments

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.

Leti avatar Feb 26 '19 08:02 Leti

node version ?

nuintun avatar Feb 27 '19 08:02 nuintun

It's v10.15.0

Leti avatar Feb 27 '19 08:02 Leti

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

nuintun avatar Feb 27 '19 08:02 nuintun

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.

Leti avatar Mar 12 '19 14:03 Leti

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!

aaronbean avatar Apr 24 '19 20:04 aaronbean

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...

Leti avatar May 09 '19 13:05 Leti