🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.vbasic
Article #74

Re: Multimedialne bazy danych

#74
From: Marcin
Date: Thu, 23 Oct 1997 00:00
53 lines
1809 bytes
Moze byc taka funkcja:

Public Sub WriteBinary(ByRef fld As Field, ByRef strPath As String)
On Error GoTo WriteError
    Dim hFile As Integer
    Dim bOpened As Boolean
    Dim strBuffer As String
    Dim lLen As Long
    Dim lWritten As Long
    Dim lChunk As Long
    
    hFile = FreeFile
    bOpened = False
    lLen = FileLen(strPath)
    lWritten = 0
    Open strPath For Binary Access Read Shared As hFile
    bOpened = True
    
    Do While Not EOF(hFile)
        lChunk = IIf(lLen - lWritten > 16384, 16384, lLen - lWritten)
        If Not lChunk > 0 Then Exit Do
        strBuffer = String$(lChunk, 0)
        Get hFile, , strBuffer
        fld.AppendChunk strBuffer
        lWritten = lWritten + lChunk
    Loop
    Close hFile
    bOpened = False
    Exit Sub
WriteError:
    If bOpened Then Close hFile
    ErrorHandler
End Sub

Robi to co trzeba, pod warunkiem, ze pole jest w edycji (wraz z calym
wierszem)
i jest chunkowalne (memo).
Metoda do odczytu - analogicznie, tylko w druga strone

pozdrowka
martek

Rafa� Trzebi�ski <b...@chem.atr.bydgoszcz.pl> wrote in article
<344CAB...@chem.atr.bydgoszcz.pl>...
> Czesc!
> 
> W jaki sposob mozna przypisac do obiektu Recordset obrazek.
> Konkretnie mowiac zalozmy ze w tablicy znajduja sie rekordy po trzy
> pola, chcialbym do pola2 dopisac obrazek (nie siezke dostepu).
> 
> Bardzo prosze o szybka odpowiedz!
> 
Technical Details
Message-ID: <01bcdf88$ef44a190$c9c974c3@malibu>
Path: mbox-mo1.pugleaf.net!unknown!not-for-mail
References: <344CAB05.3B2E@chem.atr.bydgoszcz.pl>

Show Full Headers
Complete Article Headers
From: "Marcin" <mar...@matrix.com.pl>
Subject: Re: Multimedialne bazy danych
Date: 1997/10/23
Message-ID: <01bcdf88$ef44a190$c9c974c3@malibu>
X-Deja-AN: 282655459
References: <344CAB05.3B2E@chem.atr.bydgoszcz.pl>
Organization: Altkom Matrix
Newsgroups: pl.comp.lang.vbasic
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit