* Patch from Ludo Brands to implement InstanceName (Bug ID 24635)

git-svn-id: trunk@24932 -
This commit is contained in:
michael 2013-06-22 13:50:44 +00:00
parent 4a9fe5d07d
commit 2b6f33711b
2 changed files with 23 additions and 5 deletions

View File

@ -69,19 +69,32 @@ const
DBTDS_72 = 10; // Microsoft SQL Server 2005
DBTDS_73 = 11; // Microsoft SQL Server 2008
//from sqlfront.h:
//from sqlfront.h , sybdb.h for freetds
DBSETHOST=1;
DBSETUSER=2;
DBSETPWD=3;
DBSETAPP=4;
DBSETAPP={$IFDEF freetds}5{$ELSE}4{$ENDIF};
{$IFDEF freetds}
DBSETHID= 4;
DBSETBCP= 6;
DBSETNATLANG= 7;
DBSETNOSHORT= 8;
DBSETHIER= 9;
DBSETCHARSET= 10;
DBSETPACKET= 11;
DBSETENCRYPT= 12;
DBSETLABELED= 13;
DBSETDBNAME= 14;
{$ELSE}
DBSETID=5;
DBSETLANG=6;
DBSETSECURE=7;
DBSET_LOGINTIME=10;
DBSETFALLBACK=12;
{$ENDIF}
//These two are defined by Microsoft for dbsetlversion():
DBVER42={$IFDEF freetds}DBVERSION_42{$ELSE}8{$ENDIF};
DBVER60={$IFDEF freetds}DBVERSION_71{$ELSE}9{$ENDIF};
DBSET_LOGINTIME=10;
DBSETFALLBACK=12;
//dboptions:
DBNOAUTOFREE = {$IFDEF freetds}15{$ELSE}8{$ENDIF};
DBTEXTLIMIT = {$IFDEF freetds}7{$ELSE}4{$ENDIF};

View File

@ -30,7 +30,8 @@
CharSet - if you use Microsoft DB-Lib and set to 'UTF-8' then char/varchar fields will be UTF8Encoded/Decoded
if you use FreeTDS DB-Lib then you must compile with iconv support (requires libiconv2.dll) or cast char/varchar to nchar/nvarchar in SELECTs
Params - "AutoCommit=true" - if you don't want explicitly commit/rollback transactions
"TextSize=16777216 - set maximum size of text/image data returned
"TextSize=16777216" - set maximum size of text/image data returned
"ApplicationName=YourAppName" Set the app name for the connection. MSSQL 2000 and higher only
}
unit mssqlconn;
@ -193,6 +194,7 @@ const
SBeginTransaction = 'BEGIN TRANSACTION';
SAutoCommit = 'AUTOCOMMIT';
STextSize = 'TEXTSIZE';
SAppName = 'APPLICATIONNAME';
var
@ -428,6 +430,9 @@ begin
else
dbsetlcharset(FDBLogin, PChar(CharSet));
if Params.IndexOfName(SAppName) <> -1 then
dbsetlname(FDBLogin, PChar(Params.Values[SAppName]), DBSETAPP);
//dbsetlname(FDBLogin, PChar(TIMEOUT_IGNORE), DBSET_LOGINTIME);
dbsetlogintime(10);