Page 1 of 1
Server name for mongodb
Posted: Sun 04 Mar 2018 22:48
by inageib
I am trying to connect to mongodb from unidac and I supplied server name like this
cluster0-shard-00-00-xxxxx.mongodb.net
also port 27017, user name and password but I did not able to connect from Delphi !! why is that ? I was able to connect from mongodb compass btw
error:
Failed to read 66321 bytes from socket within 300000 milliseconds..
I am trying to connect to MongoDB Atlas not a local server
Re: Server name for mongodb
Posted: Tue 06 Mar 2018 13:00
by azyk
Perhaps the reason for this error is not UniDAC, but the client libraries that you use to connect to MongoDB Atlas.
Try to use the libbson-1.0.dll and libmongoc-1.0.dll client libraries from Devart ODBC Driver for MongoDB for Windows (
https://www.devart.com/odbc/mongodb/download.html ) to avoid this error. By default, 32-bit versions of these libraries will be installed to the "C:\Program Files (x86)\Devart\ODBC\MongoDB\Win32\" folder.
For example:
Code: Select all
UniConnection1.ProviderName := 'MongoDB';
UniConnection1.Server := 'cluster0-shard-xx-xx-xxxxx.mongodb.net';
UniConnection1.Port := 27017;
UniConnection1.Username := 'username';
UniConnection1.Password := '********';
UniConnection1.SpecificOptions.Values['MongoDB.BSONLibrary'] := 'C:\Program Files (x86)\Devart\ODBC\MongoDB\Win32\libbson-1.0.dll';
UniConnection1.SpecificOptions.Values['MongoDB.ClientLibrary'] := 'C:\Program Files (x86)\Devart\ODBC\MongoDB\Win32\libmongoc-1.0.dll';
UniConnection1.SpecificOptions.Values['MongoDB.ConnectionOptions'] := 'ssl=true&replicaSet=Cluster0-shard-0&authSource=admin';
UniConnection1.Connect;
Re: Server name for mongodb
Posted: Tue 06 Mar 2018 13:33
by inageib
I installed odbc drivers and set all parameters now I get error:
Access violation at address 001948D3 in module 'libmongoc-1.0.dll'. Read of address 00000224.
Re: Server name for mongodb
Posted: Tue 06 Mar 2018 13:56
by azyk
Please specify the full versions of the used RAD Studio and UniDAC.
If you can provide us with test credentials to connect to your MongoDB Atlas, plase
write to us using the contact form at our site:
https://www.devart.com/company/contactform.html
Re: Server name for mongodb
Posted: Tue 06 Mar 2018 13:58
by inageib
unidac 7.1.4 and Delphi Tokyo edition
I will email later the login info... thanks
Re: Server name for mongodb
Posted: Tue 06 Mar 2018 14:13
by azyk
We tested UniDAC 7.2.5 with MongoDB Atlas, Devart client libraries (libbson-1.0.dll, libmongoc-1.0.dll) and found no issues. Please specify whether the issues is reproduced on the latest UniDAC version 7.2.5. You can download it by the link on our website:
https://www.devart.com/unidac/download.html .
Re: Server name for mongodb
Posted: Wed 07 Mar 2018 04:24
by inageib
thanks alot. Yes using latest version I was able to connect to mongo atlas