对SQL的数据更新
最近在研究SQL操作,读、写、删都懂了。但是就是不知道怎么更新SQL的数据。找了很多SQL的语法,但不知道AU3怎么来操作SQL。
这是网上找到的SQL语法,请教AU3来操作SQL
update employee
set age = age+1
where first_name=''Mary'' and last_name=''Williams'';
这段语句是在employee表中,在first_name=''Mary'' 和last_name=''Williams''的行中将age加1
[ 本帖最后由 vinhua 于 2008-6-8 11:08 编辑 ] 试试这个,未测试过
$pro= ObjCreate("ADODB.Connection")
$pro.Open ('driver={SQL Server};server=' & $server & ';uid='& $USRName & ';pwd=' & $PWD & ';database='& $database)
$sql1="UPDATE employee set age = age+1 where first_name='Mary' and last_name='Williams'"
$pro.execute($sql) 谢谢这位朋友的指导,我已经OK了。:face (29):
$server = "192.168.0.1"
$USRName = "sa"
$PWD = "123456"
$database = "gametop"
$hardware = "cishu"
$pro = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$pro.Open ('driver={SQL Server};server=' & $server & ';uid='& $USRName & ';pwd=' & $PWD & ';database='& $database)
$RS.ActiveConnection = $pro
$RS.open ("select * from " & $hardware)
$sql1="UPDATE "& $hardware & " set c_num=c_num+1 where Gamename='QQ2009' and type='其他软件' and weizhi='技术部' "
$pro.Execute($sql1)
$RS.close
$pro.close {:face (114):}学习吧{:face (404):}
页:
[1]