Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem/Solution Database - any ideas

Status
Not open for further replies.

MrM121

Programmer
Aug 21, 2003
83
GB
Hi everyone,

Here is a question that I want to throw out to people, as currently, I don't have a clue as to how to do about it.

Ok, basically what I want to be able to do is to have a database that I can store problems, and there possible solutions - sounds simple enough - I have even created an algorithm to search the database by relevance (no Google, but it will do).

The catch is that I want to be able to store screen dumps, and other images. I want it to behave like a email kind of datastore, and yet I want people to be able to append to records.

I can program the database in VB, but it is the images that I don't know what to do with. Ideally I would like to store all the records in some kind of file like is done with Outlook emails.

Any suggestions are welcome.

Thank you,

Nick Meacoe
 
Hi Nick,

Could you have an identifier for each record in the DB and store the images in a folder, each image named with the records identifier??

When the user adds the new image it could replace the current one to solve the appending problem???

Not sure if this is anything like what you are after but thought I would suggest this way anyway.

Cheers

Harleyquinn
 
Too slow typing again, and probably not the pick of the solutions on the page so far.

Sorry ca8msm.
 
Right, well the database I am considering using is SQL Server, maybe Oracle, but I don't know much about it. I was considering adding the the pictures into the database by using the BLOB method, or the other one, but I wasn't really too sure, as this would bloat the database considerably.

I have also been considering the method that was mentioned by Harleyquinn.

As opposed to appending the images, that is not quite what I meant. I want to be able to add more images to the current records, and I want it displayed as you would in HTML, that kind of formatting. So the screen dumps can take the user through the solution step-by-step.

All the ideas are good so far, but I just don't know which is preferable. The way ca8msn has described using the database isn't too bad, but I need to be able to copy and paste images into a document in the VB app, and the it has to be able to store it that way.

Anymore ideas?

Nick
 
OK - both ways are usable so it is probably up to you which one you want to use.

Option 1 - store the images in the db

Could you have a "browse" dialog box rather than copy & paste. The user/you could then upload as many images as is needed to say an images table with an id linking it back to the original question. You can then create the HTML output and just insert the images where they are needed.

Option 2 - store them on your file server

As harleyquinn suggests you could call them by a defined name i.e the id. Each subsequent upload could append the next letter of the alphabet e.g. 1a.jpg, 1b.jpg etc. You can then create the HTML output and just insert the images where they are needed.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Nick,

If using my method (i'm not going to try and push it because i'm not sure if it's the best way for you to go but...) you can see if an image exists in the directory and if it does add say (1) and (2) etc. for subsequent to the DB identifier used as the file name for the subsequent images. This will enable you on selection of the question to loop through all of the images using the

left(however many characters the id is)

of the file name to find and order all of the images and copy/paste (or your prefered method) them into the required document.

Cheers

Harleyquinn
 
I think that storing the images seperately on the file server is the way to go, but the problem is now the generation of the HTML code, and what to put the output into, as I want it to be within the program.

Then, on top of that, I want the user to just see a nice HTML format kind of document, and for them to be able to type directly into it. Basically, I think that HTML needs to be used, simply to be able to store all the formatting as well, but I am not sure what controls to use - I'm a little hazy on the whole VB and HTML mix, but it needs to be done for the sake of the program.

Thanks for all your input, as it is really helpful.

Nick
 
One way to do it would be to create the html code within you vb app e.g.

Code:
strHTML = "<html>"
strHTML = strHTML & "<body>"

strHTML = strHTML & "<img src=""" & strImage1 & """>"
strHTML = "</body>"
strHTML = "</html>"

Then you could write strHTML out to a text file, name it (e.g. myfile.html) andshow it by using a webbrowser control on your form and navigating to myfile.html.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Another idea might be to create a word document based on the database information.

It could be created and temporarily stored on the users local machine, and any updates could be saved to the database on close of the document or application.

This would allow the user input part of your post and should still keep the formatting you are after.

Just an idea.

Harleyquinn

 
You see, that is what I was thinking, but my problem is that the users, not just myself, will also need to be able to create/append records, hence the reason I would have liked for them to be able to type in themselves, and paste images into the file.

Basically, what would be good is if it were possible to create some kind of frontpage kind of thing, where the HTML is then generated in the background. Therefore, when the images are pasted from the clipboard, the file is created into the file server (image1, image2, etc...) and then previewed on the page.

As I said, I am really unsure as to how to do it. I know that I could use the webbrowser control, but it doesn't allow any edits. Also, I need to brush up on how to handle rich text format, as I don't know how that would be processed into HTML too well at the moment.

Cheers,

Nick
 
Harleyquinn,

I was thinking the exact same thing last night, and I even tried playing around with the Microsoft Word control last night. I don't really know how to use it properly though, and I could only edit the document when double-clicking, which isn't too much of a problem.

The main problem is that I am really not sure on how to process the database and word stuff altogether.

Nick
 
Nick,

How are you using the Word Object (referenced using the Microsoft 10.0 Word Object Library)??

It will allow you to at the very minimal level of practise to create, edit and display a word document via VB code.

I apologise that i am unable to post an example of how to use this at the moment as I am curretly having problems using my copy of VB6, but if you do a search on this site i am sure you will turn up many examples of how to use this method.

If you are unsuccessful in the search and you are able to wait my VB should be back up again on Monday.
Unless anyone else would like to help Nick on this one while i can't???

Cheers

Harleyquinn
 
As I said, I really didn't know what I was doing with the Word Oject library, and so I didn't really go into it too deeply. I am not sure how to then save the data as HTML code, or whatever to preserve the formatting, and I have no idea how to then pluck the images and save them as files in a directory.

If you have any examples of such techniques, I would be extremely grateful.

Thank you,

Nick
 
Nick,

With regard to the images you can use a Common Dialog control (sorry, not sure how much experience you have in using them) to allow the users to select the images themselves.

You can use this to get the file path of the image, store it as a string and then use it to copy the image to a specified directory.

Something along the lines of...

Filecopy "strFileSectedByUser<the file they select>,strDestinationFolder<the pre-specified folder you want to place it in>"

To copy the file.

Hope this is a help.

Harleyquinn
 
That's just it, I don't want them to have to open up any dialog file, as that means having to save the image. What I want them to do is to simply be able to hit the print screen button, and paste the image - it is for non-technical users as much as myself.

Nick
 
Nick,

Writing to the HTML file.

You can pretty much use ca8msm's example to concatenate the string of html and then output that string to a text file.

strHTMLFile = "C:<your desired path>.html"
strHTML = "<your html string>"

Open strHTML for Output as #1
Input strHTML
Close #1

This (i think as i am working on memory alone) will create the file with desired internals.

You will then just need to display it.

Harleyquinn

Harleyquinn
 
Nick,

If you want them to use Print Screen/Paste then i would definately say using word would be the easiest way to do this. I know you said that you don't have alot of experience with the word object but i think it would be easier for you than trying to do the same with HTML via VB.

I'm sure someone on this site can show you how do to it with HTML but unfortunately i can't at the moment..

Sorry I couldn't be of more help to you at the moment.

Harleyquinn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top