Sign in to follow this  
Followers 0
yEn861220

Will AU3 can read and write database picture?

5 posts in this topic

Will AU3 can read and write database picture?

I was a beginner!

Can cite examples?

Share this post


Link to post
Share on other sites



I am sorry, I limited English proficiency.

What I mean is that the database(MS Access) read or write picture.

Share this post


Link to post
Share on other sites

@all

What he is talking about is storing pictures in a DB and reading it afterwards.

This is supported in SQLite (and other databases).

You need to store the data in "BLOB" field.

I hope this gets you going.

#include <SQLite.au3>

Local $hFile, $vData, $sFileName, $sData, $hQuery, $aRow, $sMsg
_SQLite_Startup()
_SQLite_Open()
_SQLite_Exec(-1,"CREATE TABLE IF NOT EXISTS Test (data blob);")
$vData = BinaryToString("Hello" & Chr(0) & "World"); = 48656C6C6F00576F726C64
$sData = _SQLite_Encode($vData)
_SQLite_Exec(-1,"INSERT INTO Test VALUES (" & $sData & ");")
$vData = BinaryToString(Chr(0) & @CRLF); = 000D0A
$sData = _SQLite_Encode($vData)
_SQLite_Exec(-1,"INSERT INTO Test VALUES (" & $sData & ");")
$vData = BinaryToString(Chr(0)); = 00 but this is interpreted as Number and returns 0000000000000000
$sData = _SQLite_Encode($vData)
_SQLite_Exec(-1,"INSERT INTO Test VALUES ( " & $sData & " );")
_SQLite_Query(-1,"SELECT * FROM Test;",$hQuery)
While _SQLite_FetchData ($hQuery, $aRow, 1) = $SQLITE_OK
    $sMsg &= Hex($aRow[0]) & @CR
WEnd
MsgBox(0,"Result",$sMsg)
_SQLite_Close()
_SQLite_Shutdown()

regards

ptrex

Share this post


Link to post
Share on other sites

Thank you,regards

Although I do not understand, but I will make good use of research.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0