delphi操作combobox连接数据库
ADOQuery1.Close;casenumof0:ADOQuery1.SQL.add('insertintotbluser(user_name,user_rank,u...
ADOQuery1.Close;
case num of
0:ADOQuery1.SQL.add('insert into tbluser(user_name,user_rank,user_pswd) values('''+namestr+''',"2",'''+pswdstr+''')');
1:ADOQuery1.SQL.add('insert into tbluser(user_name,user_rank,user_pswd) values('''+namestr+''',"2",'''+pswdstr+''')');
//ADOQuery1.SQL.add('insert into tbluser(user_name,user_rank,user_pswd) values("ad","2","A673D7357082A563")');
//ADOQuery1.SQL.add('insert into tbluser(user_name,user_rank,user_pswd) values('''+edit1.text+''',"2",'''+edit2.text+''')');
//ADOQuery1.SQL.add('insert into tbluser(user_name,user_rank,user_pswd) values(:a1,"2",:b1)');
//adoquery1.parameters.parambyname('a1').Value:=namestr;
//adoquery1.Parameters.ParamByName('b1').Value:=pswdstr;
ADOQuery1.Open; //打开
//ADOQuery1.Append;//开始添加数据
//ADOQuery1.Post; //提交,使添加生效
adoquery1.ExecSQL;
adoquery1.Free;
adoquery1.close;
这条语句有问题吗? 展开
case num of
0:ADOQuery1.SQL.add('insert into tbluser(user_name,user_rank,user_pswd) values('''+namestr+''',"2",'''+pswdstr+''')');
1:ADOQuery1.SQL.add('insert into tbluser(user_name,user_rank,user_pswd) values('''+namestr+''',"2",'''+pswdstr+''')');
//ADOQuery1.SQL.add('insert into tbluser(user_name,user_rank,user_pswd) values("ad","2","A673D7357082A563")');
//ADOQuery1.SQL.add('insert into tbluser(user_name,user_rank,user_pswd) values('''+edit1.text+''',"2",'''+edit2.text+''')');
//ADOQuery1.SQL.add('insert into tbluser(user_name,user_rank,user_pswd) values(:a1,"2",:b1)');
//adoquery1.parameters.parambyname('a1').Value:=namestr;
//adoquery1.Parameters.ParamByName('b1').Value:=pswdstr;
ADOQuery1.Open; //打开
//ADOQuery1.Append;//开始添加数据
//ADOQuery1.Post; //提交,使添加生效
adoquery1.ExecSQL;
adoquery1.Free;
adoquery1.close;
这条语句有问题吗? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询