Results 1 to 13 of 13

Thread: where to store image path in a database table via vb6

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2017
    Posts
    18

    where to store image path in a database table via vb6

    i have finished already creating database and table but i dont know exactly where to paste image path in a DB TABLE

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: where to store image path in a database table via vb6

    If it is a path then all it is is text so you just put it in a text field doesn't matter where in the record just needs to accept text and be long enough to hold whatever the path is.

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: where to store image path in a database table via vb6

    When I did VB6 I stored the "path" in a config table if the images were on disk. You do not need to store the path on each image filename (if they are in fact all stored in the same folder).

    Now that I do web app's the "path" is stored in a web.config file on the web server.

    How many and how small are these images?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2017
    Posts
    18

    Re: where to store image path in a database table via vb6

    text field where in a table

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2017
    Posts
    18

    Re: where to store image path in a database table via vb6

    not many just about 5 or 6 images and how to configure table, by the way all the images are on a same folder

  6. #6
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: where to store image path in a database table via vb6

    If you have that few you should consider putting them in a table in your database.

    If you are running MS SQL Server here that is running as a service on another server. If this is a multi-user system each user is going to need access to whatever share you put the images on.

    If you put them in the DB in a table you can get them the same way you get a SELECT result of regular data. No extra permissions and access problems getting to the images.

    Just something to consider.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  7. #7
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,909

    Re: where to store image path in a database table via vb6

    Hmmm, if we're truly just talking about 5 or 6 images that are used by a program, I'd probably stuff them into the resources file as custom resources, compile them into the executable, and then extract them possibly into "C:\Users\TheUser\AppData\Local\Temp" when I needed them (checking to see if they were still there from the last time I extracted them). Of course, I'd use the Windows GetTempPathW API call to get the temp folder.

    Alternatively, I'd stuff the entire images into my database, as suggested above.

    If you're packaging the images with the VB6 Package & Deploy Wizard, you can possibly just use App.Path to find them.

    Just the ideas that come to me,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Mar 2017
    Posts
    18

    Re: where to store image path in a database table via vb6

    thank you for kindest reply, but i am running ms access.

  9. #9
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,909

    Re: where to store image path in a database table via vb6

    Well, ok, I assume that means you're using Macros from within MS-Access to do your work. In that event, you're really in the wrong forum. You should be either here or here.

    However, if you're just using an Access MDB or ACCDB file, you could get the path of that file with the database "Connect" property. Even if you're just using MS-Access's VBA to attach to a SQL server, you could still open the MS-Access database and use the "Connect" property to find its location, and then save your pictures there.

    Alternatively, you could still stuff them into the MDB or ACCDB file, and extract them when you needed them. It's been awhile since I've stuffed pictures into a database, by I have done it in the past, and it's not difficult. However, if it were me, I'd check in those other forums for your answers.

    All The Best,
    Elroy

    EDIT1: Also, the title of your thread has "via vb6" in it. What does this mean? Are you using MS-Access or are you running VB6?

    Quote Originally Posted by Siddhanth View Post
    ... i am running ms access.
    Last edited by Elroy; Apr 9th, 2017 at 12:37 PM.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Mar 2017
    Posts
    18

    Re: where to store image path in a database table via vb6

    Im clueless regarding The Package and Development Wizard....baffled here...do i have to store the image path on the Description box or something..and about the Load Behavior...what is it for?

  11. #11
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: where to store image path in a database table via vb6

    Quote Originally Posted by Siddhanth View Post
    text field where in a table
    What do you mean where in table?

    You would store it in the text field you planned to store it in.
    You say you finished creating the database and if that is true then that means you have created a field that you planned to hold the path and/or filename in. That is where you would put it. If you have not created a field to hold this data then you have not finished creating your database.

    In other words it is up to you where you put it.

  12. #12
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: where to store image path in a database table via vb6

    Quote Originally Posted by szlamany View Post
    If you have that few you should consider putting them in a table in your database.

    If you are running MS SQL Server here that is running as a service on another server. If this is a multi-user system each user is going to need access to whatever share you put the images on.

    If you put them in the DB in a table you can get them the same way you get a SELECT result of regular data. No extra permissions and access problems getting to the images.

    Just something to consider.
    This is the approach that I have advocated for the longest period of time. Once you have it in a DB, you automatically get all the access issues sorted.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  13. #13
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: where to store image path in a database table via vb6

    Quote Originally Posted by abhijit View Post
    This is the approach that I have advocated for the longest period of time. Once you have it in a DB, you automatically get all the access issues sorted.
    There is a lot of truth to this.

    For DR - disaster recovery - having the image in the DB makes so much sense.

    I always called this the single-suitcase - everything in the same place.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Tags for this Thread

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