Создание DBExpress-Connection в Run-Time

Советы » Interbase » Создание DBExpress-Connection в Run-Time

procedure

TVCLScanner.PostUser(const

Email, FirstName, LastName: WideString); var

Connection: TSQLConnection; DataSet: TSQLDataSet; begin

Connection := TSQLConnection.Create(nil

); with

Connection do

begin

ConnectionName := 'VCLScanner'; DriverName := 'INTERBASE'; LibraryName := 'dbexpint.dll'; VendorLib := 'GDS32.DLL'; GetDriverFunc := 'getSQLDriverINTERBASE'; Params.Add('User_Name=SYSDBA'); Params.Add('Password=masterkey'); Params.Add('Database=milo2:D:frankwebservicesumlbank.gdb'); LoginPrompt := False

; Open; end

; DataSet := TSQLDataSet.Create(nil

); with

DataSet do

begin

SQLConnection := Connection; CommandText := Format('INSERT INTO kings VALUES("%s","%s","%s")', [Email, FirstN, LastN]); try

ExecSQL; except

end

; end

; Connection.Close; DataSet.Free; Connection.Free; end

;

Другое по теме:

Категории

Статьи

Советы

Copyright © 2022 - All Rights Reserved - www.delphirus.com