Files as records

  • I have a field in a table which I want to relate to an image in an external file. How do I point the field to a specific file/directory. Is there a special data type I need to give the field?

     


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • varchar works fine.

  • and how would i go about pointing to the field to the file/directory?

     


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • that's a job for the front end


    * Noel

  • Hi Andrew,

    must have missed your question. Sorry

    So you've decided not to store images in a db? Ok.

    Actually Allen and noeld have given this time all information to you that you need. Do you need help with an example? Look at the VB help for the use of a PictureBox (or ImageBox?). That shows you how to use a string to pass to the control and display the corresponding image. All you need to do is retrieve that string from your db.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Yeah, an example would be good......


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • Okay

    Create a new exe-project in VB with a DriveListBox, DirListBox,FileListBox and an Image control

    Add the following code

    Private Sub Dir1_Change()

    File1.Path = Dir1.Path

    End Sub

    ---

    Private Sub Drive1_Change()

    Dir1.Path = Drive1.Drive

    End Sub

    ---

    Private Sub File1_Click()

    On Error Resume Next

    Image1.Picture = LoadPicture(File1.Path & "\" & File1.FileName)

    End Sub

    Unless I have not forgotten something you shold see something inside the Image control once the File selected from the file list can be interpreted an an image.

    HTH

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Image1.Picture = LoadPicture(File1.Path & "\" & File1.FileName)

    Anyone know what the above would be using a Windows Media Player plugin (named media1)

    Would it be something like...

     

    media1.currentMedia = LoadVideo(File1.Path & "\" & File1.FileName) ????


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • Andrew, why are you asking on how to load pictures, when you actually want to play media files?

    Although I don't know for sure that it is correct, I would look at projects -> components. At the bottom of that list you should find 'Windows Media Player'. I bet you'll also find source code on how to use on the internet. And may I throw in my favority site on VB?

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • >>Andrew, why are you asking on how to load pictures, when you actually >>want to play media files?

    Confusion! i need to do both!

    Just need to know the equivalent for LoadPicture where media player is concerned. I have the media player component.

     

     

     


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply