How to store/retrieve pictures in an ODBC Database ?

Everything else that doesn't fall into one of the other PB categories.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

thanx guys, i appreciate your diagnostic...

about our 4096 bytes limitation, one solution could be this one :
works very well !

Code: Select all

Procedure.s GetDatabaseText()
  
  If DatabaseQuery("SELECT LENGTH(text) FROM table WHERE 1;")
    If NextDatabaseRow()
      result$="" : size=Val(GetDatabaseString(0))
      For i=1 To size Step 4095
        If DatabaseQuery("SELECT SUBSTRING(text,"+Str(i)+",4095) FROM table WHERE 1;")
          If NextDatabaseRow() : result$+GetDatabaseString(0) : EndIf
        EndIf
      Next
      ProcedureReturn result$
    EndIf
  EndIf
  
EndProcedure
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Beforegod
New User
New User
Posts: 5
Joined: Mon Sep 26, 2005 1:19 pm

Post by Beforegod »

Sadly the code works not for me.

I have stored some jpeg pictures in my database and i dont have a clue how to retrieve this from the db. Some hints for me ? ;)
Post Reply