#AutoIt3Wrapper_UseX64 = n
;#include <Access.au3>
#include <WindowsConstants.au3>
$mdb_data_path = "DB0a.mdb"
$mdb_data_pwd = ""
$T = ""
$tblname = "mydb" ;表名
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $mdb_data_path & ";Jet Oledb:Database Password=" & $mdb_data_pwd)
$RS = ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $addfld
Sleep(1000)
$hHandle1 = FileOpen("捕获2.PNG", 16)
$fRead1 = Binary(FileRead($hHandle1))
$addfld.Execute("insert into mydb (Name,Data) values ('捕获2.PNG'," & $fRead1 & ")");添加一条
;$RS.close
;$addfld.close
MsgBox(0, "提示:", "添加一条录入!", 1)
_duXCICO()
;EndFunc ;==>Example
Func _duXCICO()
Global $dirTMP1 = @ScriptDir & "\XCICO"
If Not FileExists($dirTMP1) Then DirCreate($dirTMP1)
Local $MyIco
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $mdb_data_path & ";Jet Oledb:Database Password=" & $mdb_data_pwd)
$RS = ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $addfld
;读取数据库
;不知道模仿的对不?希望把您的代码发来学习学习,我的邮箱zhxj5276@163.com
$RS.open("select Data from mydb where Name='捕获2.PNG' ")
Local $tFileWrite1 = $RS.Fields(0).value
FileWrite("XCICO\Aa2.PNG", $RS.Fields(0).value)
$RS.close
ShellExecute(@ScriptDir & "\XCICO\Aa2.PNG")
$addfld.close
EndFunc ;==>_duXCICO
|