escape string
Posted: 01.09.2007, 14:31
i have a console program.
thanks all
sry 4 bad English - I'm from Russia
Code: Select all
uses
ZConnection,ZQuery;
var
Connection : TZConnection;
Dataset : TZQuery;
login : string;
begin
Connection := TZConnection.Create(nil);
Dataset := TZQuery.Create(nil);
Dataset.Connection := fConnection;
Dataset.ReadOnly := FALSE;
Connection.Protocol := 'mysql-5'; //actually it's getting from config
Connection.HostName := MainProc.DatabaseOptions.RealmHost;
Connection.Port := MainProc.DatabaseOptions.RealmPort;
Connection.Database := MainProc.DatabaseOptions.RealmDB;
Connection.User := MainProc.DatabaseOptions.RealmUser;
Connection.Password := MainProc.DatabaseOptions.RealmPass;
Connection.Connect;
login := GetLogin; //function takes username from Edit box
//i need to escape string(login) now to avoid hack/crash. but how ???
//something sql-requests with this login
Connection.Disconnect;
Dataset.Free;
Connection.Free;
end.
sry 4 bad English - I'm from Russia