|
$name = GUICtrlRead($Input2_1,"")
$xb = GUICtrlRead($Combo2_1,"")
$zjlx = GUICtrlRead($Combo2_2,"")
$zjbh = GUICtrlRead($Input2_2,"")
$dizhi= GUICtrlRead($Input2_3,"")
If $name = "" Or $zjbh="" Or $dizhi="" Then
MsgBox(64, "提示", "各项不能为空,请正确填写!")
ElseIf 怎么检测已存在? Then
MsgBox(0,"","存在")
Else
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $mdb_data & ";Jet Oledb:Database Password=" & $mdb_pwd)
$addfld.Execute("insert into chenweidong (姓名,性别,证件类型,证件编号,地址) values('"&$name&"','"&$xb&"','"&$zjlx&"','"&$zjbh&"','"&$dizhi&"')")
$addfld.close
MsgBox(4096, "提示:"," 成功写入数据库!")
GUISwitch($Form2)
GUISetState(@SW_HIDE)
EndIf |
|