Topic: Save failed

Hello, when I load an image from the script it appears on the form but I can't save it in the specified folder. It's DBImage2 from the "AddBirds" form. I must have forgotten something?

Post's attachments

Attachment icon Les oiseaux.zip 1.27 mb, 201 downloads since 2025-06-23 

Destiny

Re: Save failed

Demat Crozon
J'ai testé ton appli pour générer ton erreur.
Je suppose que le document 'Fiche' est une image qui doit prendre place dans le DBImage2.
J'ai donc créer un dossier Fiches dans le dossier de ton appli.
Dans la propriété CopyTo j'ai modifié ton paramètre en \Fiches.
Problème : quand je veux ajouter un nouvel oiseau et y ajouter une nouvelle photo d'oiseau (DBImage1) et sa fiche (DBImage2), pas moyen d'appeler les boîtes de dialogue permettant de choisir les images respectives.
Un problème de ce côté ?
Quelle version de MVD est utilisée ?
Un truc : n'hésite pas à commenter ton code (condition ... rôle de tel composant ...)
A te lire
JB



Demat Crozon
I tested your app to generate your error.
I assume the 'Fiche' document is an image that should be stored in DBImage2.
So I created a Files folder in your app folder.
In the CopyTo property, I changed your parameter to \Fiches.
Problem: When I want to add a new bird and add a new bird photo (DBImage1) and its fiche (DBImage2), I can't call the dialog boxes to choose the respective images.
Any problems with that?
Which version of MVD are you using?
One tip: feel free to comment on your code (conditions, role of this component, etc.).
Looking forward to hearing from you!
JB

3 (edited by Destiny 2025-06-23 07:36:58)

Re: Save failed

La version est la 6.5.
Avec le bouton Fiches du formulaire "AjoutOiseaux" l'image s'affiche mais quand je veut l'enregistrer dans le dossier "Fiches" elle n'apparait pas dans ce dossier. J'ai bien rediriger le Coty To mais rien n'y fait.

Destiny

Re: Save failed

Hi Destiny, Jean


Since you are using your procedure to open the file you need to add one line.
I am giving only part of your code:

...  
if openDialog.Execute then
  begin
    for i := 0 to OpenDialog.Files.Count-1 do
    begin
      if FileExists(OpenDialog.Files[i]) then
      begin
        //Fiche(OpenDialog.Files[i],i);
        if (i=0) then AjoutOiseaux.DBImage2.Picture.LoadFromFile(OpenDialog.Files[i]);
        AjoutOiseaux.DBImage2.dbFileName := OpenDialog.Files[i];         // < --------------- ADD
      end;
    end;
  end;
...

5 (edited by Destiny 2025-06-23 13:11:02)

Re: Save failed

Great, it works! The images are saved in the folder of my choice.
Thanks, sparrow.
Thanks, Jean.

Destiny

6 (edited by Destiny 2025-06-25 14:42:56)

Re: Save failed

Hi, I'm still having trouble saving an image to the folder of my choice. The image displays correctly, but when I save it, it doesn't appear in the "Copy to" folder and won't open. Is there a solution?
--------
Slt, j'ai toujours un problème pour enregistrer une image dans le dossier de mon choix, l'image s'affiche correctement et quand je l'enregistre elle n'apparait pas dans le "Copy to" et ne s'ouvre pas.
Y a t'il une solution?

Post's attachments

Attachment icon Les oiseaux.zip 1.27 mb, 177 downloads since 2025-06-25 

Destiny

Re: Save failed

Hi Destiny


Fixed

Post's attachments

Attachment icon Les oiseaux-m.zip 1006.42 kb, 209 downloads since 2025-06-25 

Re: Save failed

Thanks Moineau, so far everything is going well.

Destiny

Re: Save failed

Hello, I'm still having a problem because some files won't save and won't display. I've searched but I can't find the solution. Is there a mistake?
------------------
Bonjour, je rencontre toujours un problème car certaines fiches ne veulent pas s'enregistrer et ne s'affichent pas. j'ai chercher mais je ne trouve pas la solution. Est-ce qu'il y a une erreur ?

Post's attachments

Attachment icon Les oiseaux.zip 1.75 mb, 190 downloads since 2025-06-28 

Destiny

Re: Save failed

Hi Destiny
Fixed and supplemented. If something is wrong, please write.

Post's attachments

Attachment icon Les oiseaux-m1.zip 1.45 mb, 199 downloads since 2025-06-28 

Re: Save failed

I've tested it several times with different images, and it works. If I find a mistake, I'll let you know, but it seems to be working.
Thanks, Moineau.

Destiny

Re: Save failed

After adding data the program works correctly, thanks again Moineau.

Destiny