如何delphi中SQL避免非法字符,单引号’三种方法
展开全部
UName :=stringreplace(ComBoUser.Text,'''','''''',[rfReplaceAll]);
UPwd :=StringReplace(EPassword.Text ,'''','''''',[rfReplaceAll]);
Sql :='select UAuth from VUser where UName=''' +UName +''' and UPwd=''' +UPwd +'''';
adoquery1.SQL.Add(Sql);
UPwd :=StringReplace(EPassword.Text ,'''','''''',[rfReplaceAll]);
Sql :='select UAuth from VUser where UName=''' +UName +''' and UPwd=''' +UPwd +'''';
adoquery1.SQL.Add(Sql);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询