Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Delphi/Agenda 1.1/Sources/   (Columbo Version 0.7©)  Datei vom 4.1.2008 mit Größe 2 kB image not shown  

Quelle  DBAccess.pas   Sprache: Delphi

 
unit DBAccess;

interface

uses
  SqlExpr, SqlConst, DBXpress, DB, Math, SysUtils,
  Utilities, StrUtils;

function MySQLFeedback(SQ:TSQLConnection;
                       Vorname, Name, Email, Title,
                       Version, Itemindex,
                       Kommentar, IP, Country :String):boolean;

procedure SQBeforeConnect(SQ:TSQLConnection;Passw:String;Crypt:String);
implementation

function MySQLFeedback(SQ:TSQLConnection;
                       Vorname, Name, Email, Title,
                       Version, Itemindex,
                       Kommentar, IP, Country :String):boolean;
var
  SQLstmt: Ansistring;
  stmtParams: TParams;
  CC:SQLResult;
  Res:boolean;
begin
  stmtParams := TParams.Create;
  SQLstmt := 'insert into feedbacks.feedback '
         + ' (Datum, Vorname, Name, Email, Produkt, '
         + ' Version, Bewertung, Kommentar, IP, Country) '
         + ' values( CURRENT_TIMESTAMP '
         + ' ,"'+Vorname+'" '
         + ' ,"'+Name+'" '
         + ' ,"'+Email+'" '
         + ' ,"'+Title+'" '
         + ' ,"'+Version+'" '
         + ' ,'+ItemIndex+' '
         + ' ,"'+Kommentar+'" '
         + ' ,"'+IP+'"'
         + ' ,"'+Country+'")';
  ;
  try
    Res := False;
    SQ.LoadParamsOnConnect := True;
    SQ.LoginPrompt := True;
    SQ.Connected := True;
    CC:=SQ.Execute(SQLstmt,stmtparams,nil);
    if CC = 0 then   //OK
      Res:=true
    else if CC = 1 then  // Warnung ?
      Res:=true
     else
      Res:=false
  finally
    stmtParams.Free;
  end;
  MySQLFeedback:=Res
end;

// set SQL connection
procedure SQBeforeConnect(SQ:TSQLConnection;Passw:String;Crypt:String);
Var User:String;
begin
  with SQ do begin
    Params.Values['BlobSize']          := '-1';
    Params.Values['Database']          := 'feedbacks';
    Params.Values['DriverName']        := 'MYSQL';
    Params.Values['ErrorResourceFile'] := '';
    Params.Values['HostName']          := 'www.cococo.de';
    Params.Values['LocaleCode']        := '0000';
    Params.Values['Password']          := Passw;
    User                               := LowerCase(Crypt);
    Params.Values['User_Name']         := User;
   SQ.ParamsLoaded := true;
  end
end;

end.

 

93%


¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.