Hi,
Is possible to use "instance name" in host connection like bellow? server001\instanceABC
I'm using FPC 2.6.2
Thanks,
Marcos Douglas

Mailing lists / fpc-pascal / 2013-06
16 messages · 3 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
Is possible to use "instance name" in host connection like bellow? server001\instanceABC
I'm using FPC 2.6.2
Thanks,
Marcos Douglas
Marcos Douglas wroteHi, Is possible to use "instance name" in host connection like bellow? server001\instanceABC
Small linguistic remark: it is below, not bellow :-)
To bellow is something quite different :)
That said: it should be possible, SQLDB passes the string on as-is.
Michael.
Is possible to use "instance name" in host connection like bellow? server001\instanceABC…
The error is:
Error 20002
Adaptive Server connection failed
I found some links, but I do not know how FreeTDS is used in FPC: http://stackoverflow.com/questions/7590944/freetds-connection-problems-on-linux http://stackoverflow.com/questions/10121212/cannot-connect-to-sql-server-database-using-pymssql-but-can-connect-using-underl
Marcos Douglas
Try adding it in databasename.
Michael.
Small linguistic remark: it is below, not bellow :-) To bellow is something quite…
Ops! Sorry! :)
That said: it should be possible, SQLDB passes the string on as-is.
This link talk about UDP protocol request to know what port is used: http://www.mssqltips.com/sqlservertip/2661/how-to-connect-to-a-sql-server-named-instance/
I do not know if the drive do that...
Marcos Douglas
Try adding it in databasename. Michael.
But this is a hostname info, not database name. (?)
Marcos Douglas
The error is: Error 20002 Adaptive Server connection failed I found some links, but I do…
This should work. Can you connect with another client using the instance? tsql?
I have encountered this problem with sql server when the SQL Server Browser service is not started. The name is a bit confusing because it is needed for clients to be able to contact with a named instance. If this service is down, you can only connect with a port number. It listens normally on port port 1434 and responds with the port number for the instance.
Another option is to define the connection in freetds.conf. Something like [myserver001]
host = server001
instance = instanceABC
tds version = 8.0
Don't specify a port when you specify an instance. They are mutually exclusive.
Ludo
I can specify the version? I'm using MSSQL 2008
The freetds.conf file has priority to set configurations even if the mssqlconn has this?
dbsetlversion(FDBLogin, DBVERSION[IsSybase]);Don't specify a port when you specify an instance. They are mutually exclusive.
Ok.
Worked but I have another problem:
To connect in DB of my client I need to pass the Application Name parameter. I tried to use Params property but didn't worked so, I changed the mssqlconn:
dbsetlname(FDBLogin, PChar('MyApp'), DBSETAPP);But didn't worked... Can you help me?
Thanks,
Marcos Douglas
Params won't work. There are only a few keywords supported by sqldb.
dbsetlname(FDBLogin, PChar('MyApp'), DBSETAPP); should work. Did you put it before the call to dbopen?
Ah, just found out that DBSETAPP is wrongly defined for FreeTDS. It should be 5 instead of 4 according to include/sybdb.h. Try dbsetlname(FDBLogin, PChar('MyApp'), 5);
Ludo
Aff! I would post before you! :)
You're right I used DBSETID:
dbsetlname(FDBLogin, PChar('MyApp'), DBSETID);You think is better use 5 instead DBSETID? The source will change?
Thank you very much!
Marcos Douglas
Ah, you want a patch? -- should check the Params if there is the 'Application Name' parameter.
Marcos Douglas
Can you confirm it works with dbsetlname(FDBLogin, PChar('MyApp'), 5) ? If that is the case I'll make a patch for dblib.pp and will add an application parameter to mssqlconn.
Ludo
Yes, I confirm. The ApplicationName was shown in Profiler tool.
Marcos Douglas
Patch in http://bugs.freepascal.org/view.php?id=24635. New parameter is "ApplicationName".
Ludo
Applied.
Michael.
Patch in http://bugs.freepascal.org/view.php?id=24635. New parameter is "ApplicationName".
Thank you.
Marcos Douglas