求购AU3读写带MDW工作组的MDB数据库实例 100RMB [停止交易]
本帖最后由 xsjtxy 于 2010-9-29 22:10 编辑数据库文件下载
QQ191148964 我的脚本,能连接,但是不能写
$mdb=@ScriptDir&"\数据库文件.mdb"
$Database=@ScriptDir&"\MDW文件.MDW"
$userid="datamaintain"
$userPassword="wxwgisyigfzlsndcscp"
$mdbpwd="zhrmghg1949jgqz"
$sCardID="123456789"
$k=""
$cRemain="¥10.00"
$sType="计费卡"
$sCardType="身份证"
$dtTime="2010-09-27 17:24:37"
$iState="0"
$T="*"
$tblname="tTmpCard"
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;User ID="&$userid&";Password="&$userPassword&";Data Source="&$mdb&";Persist Security Info=False;Jet OLEDB:System Database="&$Database&";Jet Oledb:Database Password="&$mdbpwd)
$addfld.Execute("insert into tywb (sCardID,sIDCard,sMemo,cRemain,sType,iRest,sCardType,sName,dtTime,iState,sfixOpt,sPwd) values('"&$sCardID&"','"&$k&"','"&$k&"','"&$cRemain&"','"&$sType&"','"&$k&"','"&$sCardType&"','"&$k&"','"&$dtTime&"','"&$iState&"','"&$k&"','"&$k&"')")
$addfld.close
MsgBox(4096, "提示:","成功写入数据库!")
----> COM Error Encountered in 新建 AutoIt v3 脚本.au3
----> $ErrorScriptline = 25
----> $ErrorNumberHex = 80020009
----> $ErrorNumber = -2147352567
----> $ErrorWinDescription =
----> $ErrorDescription = Microsoft Jet 数据库引擎找不到输入表或查询 'tywb'。 确定它是否存在,以及它的名称的拼写是否正确。
----> $ErrorSource = Microsoft JET Database Engine
----> $ErrorHelpFile =
----> $ErrorHelpContext = 5003011
----> $ErrorLastDllError = 0 Global $MyError = ObjEvent('AutoIt.Error', 'MyErrFunc')
$mdb=@ScriptDir&"\数据库文件.mdb"
$Database=@ScriptDir&"\MDW文件.MDW"
$userid="datamaintain"
$userPassword="wxwgisyigfzlsndcscp"
$mdbpwd="zhrmghg1949jgqz"
$sCardID="123456789"
$k=""
$cRemain="¥10.00"
$sType="计费卡"
$sCardType="身份证"
$dtTime="2010-09-27 17:24:37"
$iState="0"
$T="*"
$tblname="tTmpCard"
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;User ID="&$userid&";Password="&$userPassword&";Data Source="&$mdb&";Persist Security Info=False;Jet OLEDB:System Database="&$Database&";Jet Oledb:Database Password="&$mdbpwd)
$addfld.Execute("insert into tywb (sCardID,sIDCard,sMemo,cRemain,sType,iRest,sCardType,sName,dtTime,iState,sfixOpt,sPwd) values('"&$sCardID&"','"&$k&"','"&$k&"','"&$cRemain&"','"&$sType&"','"&$k&"','"&$sCardType&"','"&$k&"','"&$dtTime&"','"&$iState&"','"&$k&"','"&$k&"')")
$addfld.close
MsgBox(4096, "提示:","成功写入数据库!")
Func MyErrFunc()
$i = '----> COM Error Encountered in ' & @ScriptName & @CR & _
'----> $ErrorScriptline = ' & $MyError.scriptline & @CR & _
'----> $ErrorNumberHex = ' & Hex($MyError.number, 8) & @CR & _
'----> $ErrorNumber = ' & $MyError.number & @CR & _
'----> $ErrorWinDescription = ' & StringStripWS($MyError.WinDescription, 2) & @CR & _
'----> $ErrorDescription = ' & StringStripWS($MyError.description, 2) & @CR & _
'----> $ErrorSource = ' & $MyError.Source & @CR & _
'----> $ErrorHelpFile = ' & $MyError.HelpFile & @CR & _
'----> $ErrorHelpContext = ' & $MyError.HelpContext & @CR & _
'----> $ErrorLastDllError = ' & $MyError.LastDllError
MsgBox(4096, ClipPut($i), $i)
Exit
EndFunc 回复 4# 破帽遮颜
不好意思。表不是tywb
是tTmpCard iRest这个列表里面的数据是从右开始的。 这种数据应该怎么写进去? Global $MyError = ObjEvent('AutoIt.Error', 'MyErrFunc')
$mdb=@ScriptDir&"\数据库文件.mdb"
$Database=@ScriptDir&"\MDW文件.MDW"
$userid="datamaintain"
$userPassword="wxwgisyigfzlsndcscp"
$mdbpwd="zhrmghg1949jgqz"
$sCardID= Random(1, 10000000, 1)
$k="0"
$cRemain="¥10.00"
$sType="计费卡"
$sCardType="身份证"
$dtTime="2010-09-27 17:24:37"
$iState="0"
$T="*"
$tblname="tTmpCard"
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;User ID="&$userid&";Password="&$userPassword&";Data Source="&$mdb&";Persist Security Info=False;Jet OLEDB:System Database="&$Database&";Jet Oledb:Database Password="&$mdbpwd)
Local $Records = ObjCreate("ADODB.Recordset")
$Records.ActiveConnection = $addfld
$Records.Open('Select * From tTmpCard')
While Not $Records.eof And Not $Records.bof
MsgBox(4096, '', $Records.fields(0).value)
$Records.movenext
WEnd
$Text = "insert into tTmpCard (sCardID,sIDCard,sMemo,cRemain,sType,iRest,sCardType,sName,dtTime,iState,sfixOpt,sPwd) values("&$sCardID&","&$k&","&$k&",'"&$cRemain&"','"&$sType&"',"&$k&",'"&$sCardType&"',"&$k&",'"&$dtTime&"',"&$iState&","&$k&","&$k&")"
MsgBox(4096, '', $Text)
$addfld.Execute($Text)
$Records.Close
$addfld.close
MsgBox(4096, "提示:","成功写入数据库!")
Func MyErrFunc()
$i = '----> COM Error Encountered in ' & @ScriptName & @CR & _
'----> $ErrorScriptline = ' & $MyError.scriptline & @CR & _
'----> $ErrorNumberHex = ' & Hex($MyError.number, 8) & @CR & _
'----> $ErrorNumber = ' & $MyError.number & @CR & _
'----> $ErrorWinDescription = ' & StringStripWS($MyError.WinDescription, 2) & @CR & _
'----> $ErrorDescription = ' & StringStripWS($MyError.description, 2) & @CR & _
'----> $ErrorSource = ' & $MyError.Source & @CR & _
'----> $ErrorHelpFile = ' & $MyError.HelpFile & @CR & _
'----> $ErrorHelpContext = ' & $MyError.HelpContext & @CR & _
'----> $ErrorLastDllError = ' & $MyError.LastDllError
MsgBox(4096, ClipPut($i), $i)
Exit
EndFunc 回复 7# xsjtxy
已经写进去了~ 回复 8# 破帽遮颜
如果更新呢?
页:
[1]