INSERT in SQLSERVER with DELPHI XE4

0

I am new to Delphi XE4 and can not find where my error is in the query:

INSERT into CUENTAS (codigocu,nombre,apellido,idcondiva,email) values ( :icodigocu, :inombre, :iapellido, :iidcondiva, :iemail);

The error that shows me is this:

dbexpress driver does not support the tdbxtypes.unknown data type.Vendor error message

I know there is an error in the parameters of the query, but I am not finding it. I'm new to Delphi.

Script:

unit UServerMethods;

interface

uses
  System.SysUtils, System.Classes, Data.DBXMSSQL, Data.FMTBcd, Data.DB,
  Data.SqlExpr;

type
  {$METHODINFO ON}
  TTServerMethods = class(TDataModule)
    DBEMPRESA: TSQLConnection;
    SQLDataSetInsertCuenta: TSQLDataSet;
  private
    { Private declarations }
  public
    { Public declarations }
    function setCuenta(var icodigocu: integer; var inombre: string; var iapellido: string;var iicondiva:string; var iemail: string):String;
  end;
   {$METHODINFO OFF}
   //falta crear funciones para cada modelo
var
  TServerMethods: TTServerMethods;

implementation

{%CLASSGROUP 'Vcl.Controls.TControl'}

{$R *.dfm}
function TTServerMethods.setCuenta(var icodigocu: integer; var inombre: string; var iapellido: string;var iicondiva:string; var iemail: string):String;
begin

end;
end.

DBX Script:

object TServerMethods: TTServerMethods
  OldCreateOrder = False
  Height = 252
  Width = 379
  object DBEMPRESA: TSQLConnection
    ConnectionName = 'DBEMPRESA'
    DriverName = 'MSSQL'
    LoginPrompt = False
    Params.Strings = (
      'DriverName=MSSQL'
      'SchemaOverride=%.dbo'
      'DriverUnit=Data.DBXMSSQL'

        'DriverPackageLoader=TDBXDynalinkDriverLoader,DBXCommonDriver180.' +
        'bpl'

        'DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borla' +
        'nd.Data.DbxCommonDriver,Version=18.0.0.0,Culture=neutral,PublicK' +
        'eyToken=91d62ebb5b0d1b1b'

        'MetaDataPackageLoader=TDBXMsSqlMetaDataCommandFactory,DbxMSSQLDr' +
        'iver180.bpl'

        'MetaDataAssemblyLoader=Borland.Data.TDBXMsSqlMetaDataCommandFact' +
        'ory,Borland.Data.DbxMSSQLDriver,Version=18.0.0.0,Culture=neutral' +
        ',PublicKeyToken=91d62ebb5b0d1b1b'
      'LibraryName=dbxmss.dll'
      'VendorLib=sqlncli10.dll'
      'VendorLibWin64=sqlncli10.dll'
      'HostName=DESKTOP-KPIEO6C\SQLEXPRESS'
      'Database=DBEMPRESA'
      'MaxBlobSize=-1'
      'LocaleCode=0000'
      'IsolationLevel=ReadCommitted'
      'OSAuthentication=False'
      'PrepareSQL=True'
      'User_Name=JDario'
      'Password=qwertya'
      'BlobSize=-1'
      'ErrorResourceFile='
      'OS Authentication=False'
      'Prepare SQL=False')
    Connected = True
    Left = 40
    Top = 29
  end
  object SQLDataSetInsertCuenta: TSQLDataSet
    SchemaName = 'JDario'
    CommandText = 
      'INSERT into CUENTAS (codigocu,nombre,apellido,idcondiva,email)va' +
      'lues (:icodigocu,:inombre,:iapellido,:iidcondiva,:iemail);'
    MaxBlobSize = -1
    Params = <
      item
        DataType = ftUnknown
        Name = 'icodigocu'
        ParamType = ptInput
      end
      item
        DataType = ftUnknown
        Name = 'inombre'
        ParamType = ptInput
      end
      item
        DataType = ftUnknown
        Name = 'iapellido'#39
        ParamType = ptInput
      end
      item
        DataType = ftUnknown
        Name = 'iidcondiva'
        ParamType = ptInput
      end
      item
        DataType = ftUnknown
        Name = 'iemail'
        ParamType = ptInput
      end>
    SQLConnection = DBEMPRESA
    Left = 232
    Top = 32
  end
end
    
asked by Nahuel Jakobson 05.05.2018 в 20:58
source

0 answers