How do you use jpegs in a realbasic database on the PC 
Author Message
 How do you use jpegs in a realbasic database on the PC

Does anyone know how to use jpegs that are in a realbasic database on the
PC. It works great on the Mac but not on the PC.

Here is the code I use for the Mac and it works.

  dim db as database
  dim f as folderItem
  dim cur as databasecursor
  dim i As integer
  dim SQLstatement As string

  f = getfolderItem("Company_logos")
  if not f.exists then
    beep
    msgBox "The database file is missing."
  else
    db = openREALDatabase(f)
    if db = nil then
      beep
      msgBox "The database file could not be opened."
    else
      for i = 0 to current_company_logos.listcount-1
        if current_company_logos.selected(i) then

          SQlstatement = "select * from logos where company_id = " +
current_company_logos.Cell(i,1)
          //msgbox SQLstatement
          cur = db.SQLSelect(sqlstatement)
        end if
      next

      if cur = nil then
        //beep
        //msgBox "Error in select."
      else
        if cur.field("company_name").getString = "" then
          //beep
          //msgBox "No record found."
        else

          canvas2.backdrop = cur.field("logo").jPEGValue
        end if
      end if
    end if
    db.close
  end if

This is working great under Mac OS X however not on windows.

Thanks



Sun, 05 Dec 2004 01:55:23 GMT  
 How do you use jpegs in a realbasic database on the PC
I had to install QuickTime on the Windows machine when using
FolderItem.Openaspicture.

This might be the same for the database.

Steve



Quote:
> Does anyone know how to use jpegs that are in a realbasic database on the
> PC. It works great on the Mac but not on the PC.

> Here is the code I use for the Mac and it works.

> dim db as database
> dim f as folderItem
> dim cur as databasecursor
> dim i As integer
> dim SQLstatement As string

> f = getfolderItem("Company_logos")
> if not f.exists then
>   beep
>   msgBox "The database file is missing."
> else
>   db = openREALDatabase(f)
>   if db = nil then
>     beep
>     msgBox "The database file could not be opened."
>   else
>     for i = 0 to current_company_logos.listcount-1
>       if current_company_logos.selected(i) then

>         SQlstatement = "select * from logos where company_id = " +
> current_company_logos.Cell(i,1)
>         //msgbox SQLstatement
>         cur = db.SQLSelect(sqlstatement)
>       end if
>     next

>     if cur = nil then
>       //beep
>       //msgBox "Error in select."
>     else
>       if cur.field("company_name").getString = "" then
>         //beep
>         //msgBox "No record found."
>       else

>         canvas2.backdrop = cur.field("logo").jPEGValue
>       end if
>     end if
>   end if
>   db.close
> end if

> This is working great under Mac OS X however not on windows.

> Thanks



Sun, 05 Dec 2004 05:26:31 GMT  
 How do you use jpegs in a realbasic database on the PC
Steve,

I have QuickTime installed....

I have tried it again and the way I have it working it looks like if I try
many times to insert it into the database it works... It seems quite
intermittent so I cannot nail it down to code. I did notice that the specs
for 4.5.b3 it says that blobs are working in Windows now. Does this mean
that 4.02 has problems with blobs not written from Windows into the
database?

I got the code from the Jpegs in a Real Basic Database that is on the
realbasic.com website I recompiled this for Windows using 4.5b3 and it works
great on the PC. My application that I am writing is about 100 times more
complex and must be tweaked to work with 4.5 first before I try again.

Hopefully someone from RB will read this thread and give me some insight on
why there are bugs in the Windows Blob reading and writing in 4.02

Thanks

Eddie


Quote:
> I had to install QuickTime on the Windows machine when using
> FolderItem.Openaspicture.

> This might be the same for the database.

> Steve



> > Does anyone know how to use jpegs that are in a realbasic database on
the
> > PC. It works great on the Mac but not on the PC.

> > Here is the code I use for the Mac and it works.

> > dim db as database
> > dim f as folderItem
> > dim cur as databasecursor
> > dim i As integer
> > dim SQLstatement As string

> > f = getfolderItem("Company_logos")
> > if not f.exists then
> >   beep
> >   msgBox "The database file is missing."
> > else
> >   db = openREALDatabase(f)
> >   if db = nil then
> >     beep
> >     msgBox "The database file could not be opened."
> >   else
> >     for i = 0 to current_company_logos.listcount-1
> >       if current_company_logos.selected(i) then

> >         SQlstatement = "select * from logos where company_id = " +
> > current_company_logos.Cell(i,1)
> >         //msgbox SQLstatement
> >         cur = db.SQLSelect(sqlstatement)
> >       end if
> >     next

> >     if cur = nil then
> >       //beep
> >       //msgBox "Error in select."
> >     else
> >       if cur.field("company_name").getString = "" then
> >         //beep
> >         //msgBox "No record found."
> >       else

> >         canvas2.backdrop = cur.field("logo").jPEGValue
> >       end if
> >     end if
> >   end if
> >   db.close
> > end if

> > This is working great under Mac OS X however not on windows.

> > Thanks



Sun, 05 Dec 2004 05:43:14 GMT  
 How do you use jpegs in a realbasic database on the PC

Quote:

> I had to install QuickTime on the Windows machine when using
> FolderItem.Openaspicture.

Correct: You have to install QuickTime on Windows if you want to read
anything else than BMP picture files.

And please don't quote so much text.

Mfg
Christian

--
PLZ Suche
Das neue Postleitzahlensuchprogramm

Download unter <http://plz.macsw.de>



Sun, 05 Dec 2004 05:58:46 GMT  
 How do you use jpegs in a realbasic database on the PC

Quote:
> I did notice that the specs
> for 4.5.b3 it says that blobs are working in Windows now. Does this mean
> that 4.02 has problems with blobs not written from Windows into the
> database?

Yes, that's exactly it.  I ran into this problem multiple times, the only way it
works is to use the latest 4.5....

--
Travis Hill



Sun, 05 Dec 2004 07:16:27 GMT  
 How do you use jpegs in a realbasic database on the PC
Christian,

How do I save a BMP file to the database and retrieve it from the database
so it is usable in Realbasic?  I really do not want to use Quicktime on the
target machines.

Thanks

Eddie


Quote:

> > I had to install QuickTime on the Windows machine when using
> > FolderItem.Openaspicture.

> Correct: You have to install QuickTime on Windows if you want to read
> anything else than BMP picture files.

> And please don't quote so much text.

> Mfg
> Christian

> --
> PLZ Suche
> Das neue Postleitzahlensuchprogramm

> Download unter <http://plz.macsw.de>



Mon, 06 Dec 2004 03:47:30 GMT  
 How do you use jpegs in a realbasic database on the PC

Quote:

> Christian,

> How do I save a BMP file to the database and retrieve it from the database
> so it is usable in Realbasic?

1. Saveaspicture and openaspicture on a folderitem.
2. JPEG functions from MBS Plugin (*)
3. A new Picture2BMP function, I could easily add to my plugin, if you
need it.

(*) I could take some time to make them faster as they are not very
optimized for Windows.

Mfg
Christian

--
- Macs sind fr die, die nicht wissen wollen, warum Ihr Rechner funzt.
- Linux ist fr die, die wissen wollen, warum er funzt.
- DOS ist fr die, die wissen wollen, warum er nicht funzt und
- Windows ist fr die, die nicht wissen wollen, warum er nicht funzt.



Mon, 06 Dec 2004 04:27:47 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Looping over a directory and reading Jpegs into a database -- Realbasic 4.5

2. Matching Data Types between RealBasic and the RealBasic Database

3. Store JPEGs in RB Database structure

4. Doing FTP with REALbasic (help)

5. RealBasic Database and Export

6. RealBasic Database Date format

7. Foxpro Database - Access with REALBasic - Help

8. Altering a RealBasic Database

9. RealBasic database troubles

10. REALBasic 3.2 & Databases

11. Date SQL with REALbasic database

12. Database access in realbasic

 

 
Powered by phpBB® Forum Software