question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DLL error on connecting to Latin1_General_BIN collation server

See original GitHub issue

When using tedious, I cannot connect to SQL Server using the Latin1_General_BIN collation created using the docker image that MS puts out. The server is created using the following command:

docker run --rm -d --name sqlserver -p 1433:1433 -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Password(12)" -e "MSSQL_COLLATION=Latin1_General_BIN" mcr.microsoft.com/mssql/server:2017-latest

When attempting to connect, I get the following error:

RequestError: Could not load the DLL (server internal), or one of the DLLs it references. Reason: 126(The specified module could not be found.).
    at Parser.<anonymous> (/tmp/test/node_modules/tedious/lib/connection.js:1153:27)
    at Parser.emit (events.js:314:20)
    at Parser.<anonymous> (/tmp/test/node_modules/tedious/lib/token/token-stream-parser.js:35:14)
    at Parser.emit (events.js:314:20)
    at addChunk (/tmp/test/node_modules/tedious/node_modules/readable-stream/lib/_stream_readable.js:298:12)
    at readableAddChunk (/tmp/test/node_modules/tedious/node_modules/readable-stream/lib/_stream_readable.js:280:11)
    at Parser.Readable.push (/tmp/test/node_modules/tedious/node_modules/readable-stream/lib/_stream_readable.js:241:10)
    at Parser.Transform.push (/tmp/test/node_modules/tedious/node_modules/readable-stream/lib/_stream_transform.js:139:32)
    at doneParsing (/tmp/test/node_modules/tedious/lib/token/stream-parser.js:122:14)
    at /tmp/test/node_modules/tedious/lib/token/infoerror-token-parser.js:48:5 {
  code: 'EREQUEST',
  number: 17750,
  state: 0,
  class: 16,
  serverName: '04ed0a6c188f',
  procName: 'sp_executesql',
  lineNumber: 1
}

with the following lines being emitted by sqlserver in its error log:

2020-12-24 01:36:03.31 spid51      Error: 17750, Severity: 16, State: 0.
2020-12-24 01:36:03.31 spid51      Could not load the DLL (server internal), or one of the DLLs it references. Reason: 126(The specified module could not be found.)

I used the example connection code from the Getting Started section with the following configuration object:

var config = {
  server: "localhost",
  options: {
    database: 'master',
    encrypt: false
  },
  authentication: {
    type: "default",
    options: {  
      userName: "sa",
      password: "Password(12)",
    }
  }
};

I can connect to and query the server just fine using the following clients:

  • msnodesqlv8@2
  • sqlcmd
  • pymssql
  • PHP PDO
  • JDBC via DataGrip

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
IanChokScommented, Jan 6, 2021

OK I’ve posted help on the Microsoft forum: https://docs.microsoft.com/en-us/answers/questions/221376/dll-error-on-connecting-to-latin1-general-bin-coll.html

I’ll keep this discussion updated if I hear anything back from their side!

1reaction
IanChokScommented, Dec 25, 2020

Oh yes my bad 🤦‍♂️ I missed the -e "MSSQL_COLLATION=Latin1_General_BIN" in the run command, I’m seeing the issue as well

Read more comments on GitHub >

github_iconTop Results From Across the Web

DLL error on connecting to Latin1_General_BIN collation ...
Tedious returns an error thrown from the server: RequestError: Could not load the DLL (server internal), or one of the DLLs it references....
Read more >
Setting Character Sets and Collations - MariaDB
Both character sets and collations can be specified from the server right down to the column level, as well as for client-server connections....
Read more >
Latin1_General_BIN performance impact when changing the ...
Collations in SQL Server determine the rules for matching and sorting character data. Normally, you would choose a collation first based on ...
Read more >
10.4 Connection Character Sets and Collations
The client sends SQL statements, such as queries, over the session connection. The server sends responses, such as result sets or error messages, ......
Read more >
How to Fix the Collation and Character Set of a MySQL ...
This article only applies to Atlassian products on the server and data ... TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; ERROR 3780 (HY000): ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found