TEST - BEGIN <% 'remove the first letter to uncomment and choice the version (3.51.12 are only no error) 'wstring="DRIVER={mySQL ODBC 3.51 Driver};SERVER=192.168.0.1;PORT=3306;DATABASE=test;UID=root;PWD=pass;OPTION=16427" 'wstring="DRIVER={MySQL ODBC 5.3 Unicode Driver};SERVER=192.168.0.1;PORT=3306;DATABASE=test;UID=root;PWD=pass;OPTION=16427" wstring="DRIVER={MariaDB ODBC 3.1 Driver};SERVER=192.168.0.1;PORT=3306;DATABASE=test;UID=root;PWD=pass;OPTION=16427" Set connec=server.createobject("adodb.connection") connec.Open wstring sql="delete from testtable where id=1" set xx=connec.execute(sql) set xx=nothing sql="insert into testtable (id,file) values (1,'')" set xx=connec.execute(sql) set xx=nothing Const adOpenStatic = 3 Const adLockOptimistic = 3 Set Rs = Server.CreateObject("ADODB.Recordset") Set Rs.ActiveConnection = connec Rs.CursorType = adOpenStatic Rs.LockType = adLockOptimistic xsource="select file from testtable where id=1" Rs.Source = xsource Rs.Open Const adTypeBinary = 1 Dim BinaryStream Set BinaryStream = CreateObject("ADODB.Stream") BinaryStream.Type = adTypeBinary BinaryStream.Open BinaryStream.LoadFromFile server.mappath("image.jpg") ReadBinaryFile = BinaryStream.Read RS("file").AppendChunk ReadBinaryFile RS.Update set ReadBinaryFile=nothing BinaryStream.close set BinaryStream=nothing connec.close set connec=nothing %>
TEST - END