本帖最后由 yeqing880 于 2010-11-3 19:33 编辑
表名为pic, 数据类型为text...本机测试成功,如果mssql成功.我认为mysql同理#include <mssql.au3>
$SqlServer = "127.0.0.1"
$SqlUID = ""
$SqlPWD = ""
$SqlDataBase = "test"
$SqlConn = _MsSQLConnect($SqlUID, $SqlPWD, $SqlDataBase, $SqlServer)
If @error Then Exit
xr()
dq()
Func xr()
$file = FileOpen("1.jpg", 16)
$chars = FileRead($file)
If @error = -1 Then exit
_InsertTbl($SqlConn, "pic", "pic",$chars)
FileClose($file)
Endfunc
Func dq()
$RS = ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $SqlConn
$RS.open ("select * from pic");打开数据分表
$file = FileOpen("2.jpg", 18)
$chars = FileWrite($file,$RS.Fields (0).value)
If @error = -1 Then exit
FileClose($file)
EndFunc
|