PDA

View Full Version : Save image path in database



rivci
3rd May 2012, 11:19
Hi all, hope u could help me to solve this.

The database for my application is located in another PC. Assume it is "\\server\database.mdb". I also save some images in folder "\\server\images\".
Then I want to add an image from another PC to the database. I take out a full image file path, assume "D:\img\example.jpg", with some modification I finally got "\\server\images\example.jpg". I add this path to "database.mdb" and make a copy from "D:\img\example.jpg" to "\\server\images\example.jpg". Until this everything is working fine. So when I want to acces the image I just use "\\server\images\example.jpg".

( I am using windows, and I share "\\server\" folder, so that everyone can access it )

The problem is my user want to make "\\server\images\" can't be opened from windows explorer.
I am thinking about using TCPSocket with client and server, but a lot of effort will be needed.

Can I just make "\\server\images\" can only be accessed from my qt application?

Le_B
3rd May 2012, 12:57
use http://msdn.microsoft.com/en-us/library/windows/desktop/aa385413%28v=vs.85%29.aspx
to make sure you can access the network pass first

rivci
4th May 2012, 07:53
wow.. seem complicated to me.

I finally decide to use postgresql and save the images to database hahaha thanx again

ChrisW67
6th May 2012, 07:47
Make sure that you are correctly escaping all those backslashes in any literal path you have embedded in your program:


QString basePath = "\\\\server\\images";