Results 1 to 12 of 12

Thread: Help me please

  1. #1
    npminh
    Guest

    Angry

    In SQL Server, Northwind database, Categories table has a column "Picture", that column type is image. I think that all picture is update into data by binary type.

    But I don't know how to display that data into a real picture in VB form, And I also can't update a picture into database when I choose a picture from my application.
    Hope to hear from you soon.

  2. #2
    Fanatic Member faisalkm's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    752
    Thats b'cauz they are storing it as OLE...
    Faisal Muhammed
    Homepage:I Started making it in 1994 ...Still Under Construction
    Using

    Visual Basic 6.0 Enterprise SP5
    Embedded Visual Basic 3.0
    SQL Server 2000
    Windows 2000 Proff
    Delphi 6.0


    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  3. #3
    Fanatic Member faisalkm's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    752
    Sorry....I forgot to tell u onething...if u want I can send u the code
    Faisal Muhammed
    Homepage:I Started making it in 1994 ...Still Under Construction
    Using

    Visual Basic 6.0 Enterprise SP5
    Embedded Visual Basic 3.0
    SQL Server 2000
    Windows 2000 Proff
    Delphi 6.0


    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  4. #4
    Fanatic Member faisalkm's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    752
    Once again sorry...to display the data u don't need any code...just put an OLE control and link it with the datacontrol ...This should work for writing back to the field also. If u want to do this through a code then it's little difficult
    Faisal Muhammed
    Homepage:I Started making it in 1994 ...Still Under Construction
    Using

    Visual Basic 6.0 Enterprise SP5
    Embedded Visual Basic 3.0
    SQL Server 2000
    Windows 2000 Proff
    Delphi 6.0


    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  5. #5
    Guest
    If you don't mind, please send me your code.
    Thanks.

  6. #6
    Guest
    Put a pictureox on your form and link it to your database and field picture...

    It will display the picture when it's bound to the control...

    Gerco.

  7. #7
    Fanatic Member faisalkm's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    752
    I don't think it works Gerco...Have u tried it? It works with access but I doubt with SQL Server ? Do u think it works?
    Faisal Muhammed
    Homepage:I Started making it in 1994 ...Still Under Construction
    Using

    Visual Basic 6.0 Enterprise SP5
    Embedded Visual Basic 3.0
    SQL Server 2000
    Windows 2000 Proff
    Delphi 6.0


    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  8. #8
    Guest
    I agree with Faisalkm. The Gerco's idea doesn't work with SQL Server. The message error is can not bound picture to database.

  9. #9
    Guest
    It won't work with SQL server, you're right about that... didn't know at first..

    It works fine with access... :-(

    Perhaps export the binairy data to an array or a file and cast it to a StdPicture or something?

    Gerco.

  10. #10
    Fanatic Member faisalkm's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    752
    It will work if u use an OLE control....
    Faisal Muhammed
    Homepage:I Started making it in 1994 ...Still Under Construction
    Using

    Visual Basic 6.0 Enterprise SP5
    Embedded Visual Basic 3.0
    SQL Server 2000
    Windows 2000 Proff
    Delphi 6.0


    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  11. #11
    Guest
    Hey Gerco, do you know how to cast it to a StdPicture. For instance, .gif file

  12. #12
    Fanatic Member faisalkm's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    752
    The problem is that they are storing it as an OLE object and not as an image. There may be some headers or something that identifies this OLE object. Microsoft uses some HexaDecimal values when they first write data in to this field. But I don't think u can't cast it to Stdpicture
    Faisal Muhammed
    Homepage:I Started making it in 1994 ...Still Under Construction
    Using

    Visual Basic 6.0 Enterprise SP5
    Embedded Visual Basic 3.0
    SQL Server 2000
    Windows 2000 Proff
    Delphi 6.0


    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width