Explorar o código

* widestring fields for odbc. Patch from Mantis #19773

git-svn-id: trunk@18023 -
marco %!s(int64=14) %!d(string=hai) anos
pai
achega
134f941937
Modificáronse 1 ficheiros con 20 adicións e 0 borrados
  1. 20 0
      packages/fcl-db/src/sqldb/odbc/odbcconn.pas

+ 20 - 0
packages/fcl-db/src/sqldb/odbc/odbcconn.pas

@@ -307,6 +307,7 @@ var
   IntVal: clong;
   LargeVal: clonglong;
   StrVal: string;
+  WideStrVal: widestring;
   FloatVal: cdouble;
   DateVal: SQL_DATE_STRUCT;
   TimeVal: SQL_TIME_STRUCT;
@@ -383,6 +384,25 @@ begin
               end;
           end;
         end;
+      ftWideString, ftFixedWideChar, ftWideMemo:
+        begin
+          WideStrVal:=AParams[ParamIndex].AsWideString;
+          StrLenOrInd:=Length(WideStrVal)*sizeof(widechar);
+          if WideStrVal='' then //HY104
+             begin
+             WideStrVal:=#0;
+             StrLenOrInd:=SQL_NTS;
+             end;
+          PVal:=@WideStrVal[1];
+          Size:=Length(WideStrVal)*sizeof(widechar);
+          ColumnSize:=Size; //The defined or maximum column size in characters of the column or parameter
+          BufferLength:=Size;
+          CType:=SQL_C_WCHAR;
+          case AParams[ParamIndex].DataType of
+            ftWideMemo: SqlType:=SQL_WLONGVARCHAR;
+            else        SqlType:=SQL_WVARCHAR;
+          end;
+        end;
       ftFloat:
         begin
           FloatVal:=AParams[ParamIndex].AsFloat;