Hello!
I'm currently trying to connect to a native Navision database using .net and CFront (CFront.ocx). I have earlier managed to connect with and read data from a local database by OpenDatabase(), but when using ConnectServerAndOpenDatabase (in order to be able to use a login with name and password), I run into trouble.
I get the following error message:
"The TCP/IP-network returned the error code 10049"
The line I use for connecting is:
Call CF.ConnectServerAndOpenDatabase("NDBCN", False, "tcp", "n:\database.fdb", 10000, False, False, "myusername", "")
As I understand it, when you set the second parameter (server name) to false or 0, CFront will try to open my local database file instead of using a network connection.
Error 10049 seems to translate into "Cannot assign requested address", which looks like it's not using my local path when looking for the database.
Has anyone had similar problems? I've tried connecting using a real server address, but no luck there either.
//Erik
[/quote]
Comments
Is it a path problem ? ..... the "n:\database.fdb" should be the path used by the server.
But oh my foes and oh my friends, it gives a lovely light
I have tried different paths, the documentation mentioned "[if you] do not specify a server name, the application will search for the database file on your local computer". I took it as it would use a normal search path instead of a network one, but this is maybe wrong?
Another thing I tried was: The 'client' folder is shared on my computer, so it should be visible if you manage to get an connection to 127.0.0.1.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
But did you try
Call CF.OpenDatabase("n:\database.fdb", 100000, False) ?
www.dasautomatisering.nl
This work only if Navision Database server is running on your computer and in this case you not fill the DBName.
For Native DB server - ServerName is the host of the DB Server and DBName is empty
For Native single user access (through file) - ServerName is empty and DBName is file path to .fdb file.
For SQL - ServerName is the host of MS SQL, DBName is the name of database on MS SQL
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.