Hi.. another post from me on how to retrieve a picture of a certain person from MS Access Database using the OLE Object.. Any one who can show me some samples how?
Thanks for the time.
try the following code. this is used to retrieve picture from blob field.
Dim CN As New ADODB.Connection Dim RS As ADODB.Recordset Dim DataFile As Integer, Fl As Long, Chunks As Integer Dim Fragment As Integer, Chunk() As Byte, i As Integer, FileName As String Private Const ChunkSize As Integer = 16384 Private Const conChunkSize = 100 Private Sub Form_Load() CN.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Pubs;Data Source=Test" Dim strsql As String strsql = "SELECT * FROM pub_info where pub_id = '9999'" RS.Open strsql, CN, adOpenForwardOnly, adLockReadOnly ShowPic Set RS = Nothing Set RS = New Recordset End Sub Private Sub ShowPic() DataFile = 1 Open "pictemp" For Binary Access Write As DataFile Fl = RS!logo.ActualSize ' Length of data in file If Fl = 0 Then Close DataFile: Exit Sub Chunks = Fl \ ChunkSize Fragment = Fl Mod ChunkSize ReDim Chunk(Fragment) Chunk() = RS!logo.GetChunk(Fragment) Put DataFile, , Chunk() For i = 1 To Chunks ReDim Buffer(ChunkSize) Chunk() = RS!logo.GetChunk(ChunkSize) Put DataFile, , Chunk() Next i Close DataFile FileName = "pictemp" Picture1.Picture = LoadPicture(FileName) End Sub
you need to change your code for other database.
Whew.. Thanks for the code, i'll try understanding your code though it's a bit complicated for me to understand.. :D hehe.. Ahm, mind placing some comments on your code? or some brief explanations on some statements? Thanks again.
how about for other file like word document or video??
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.
This is the result of previous question answered :
code for the listbox - datagridview interaction
At the top of the code ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...