Inclure les images et la base de donnée dans mon programme.

skyzofrenzz Messages postés 35 Date d'inscription jeudi 19 décembre 2002 Statut Membre Dernière intervention 15 septembre 2004 - 3 sept. 2004 à 16:11
cs_ITALIA Messages postés 2169 Date d'inscription vendredi 20 avril 2001 Statut Membre Dernière intervention 30 juin 2009 - 3 sept. 2004 à 16:45
Bonjour,

J'ai un prog qui fait appel à une base de donnée Access et des image .jpg

Le gros prb c'est quand je crée le .exe et que je l'execute, j'ai les erreur suivantes : Ne trouve pas C:/...../base.mdb et image1.jpg etc...

Et je n'ai pas envie que les utilisateurs de mon prog est access a la base et aux jpg !!! cad en les ajoutant dans le meme dossier que le .exe mais qu'il soient inclu dedans.

Comment faire !!! Merci par avance de votre aide,

Salutations......

Pour info voila mon code :

' =============================Skyzo progz===========================================
Public Tjmax As Variant
Public Tradmax As Variant
Public Rthrad As Variant
Public Pd As Variant
'===============================================================================
'
'===============================================================================

Private Sub Command1_Click()
frmTARIF.Show
End Sub

Private Sub DataCombo1_Change()
'Left = (Screen.Width - Width) / 2 ' on centre sur la gauche
'Top = (Screen.Height - Height) / 2 ' et en hauteur
On Error GoTo et1
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find ("id=" & DataCombo1.BoundText)
TexteDesignation = (Adodc1.Recordset.Fields("Désignation"))
Me.Caption = "Vous avez sélectionné le référence " & Adodc1.Recordset.Fields("Référence")
'Me.Caption = "Enregistrement " & Adodc1.Recordset.AbsolutePosition & "/" & Adodc1.Recordset.RecordCount & " id=" & Adodc1.Recordset.Fields("id")
Picture1.Picture = LoadPicture("")
et1:
End Sub

Private Sub Form_Load()
'Left = (Screen.Width - Width) / 2 ' on centre sur la gauche
'Top = (Screen.Height - Height) / 2 ' et en hauteur
Picture2.Picture = LoadPicture("Okpack.jpg")
TexteReferenceRadiateur.Text = ""
TexteTemperature.Text = "0"
TexteIntensite.Text = "0"
TexteDesignation.Text = ""
End Sub

Private Sub Quitter_Click()
End
End Sub

Private Sub Recommencer_Click()
TexteReferenceRadiateur.Text = ""
TextDesignationrad.Text = ""
TexteTemperature.Text = "0"
TexteIntensite.Text = "0"
Picture1.Picture = LoadPicture("")
'Left = (Screen.Width - Width) / 2 ' on centre sur la gauche
'Top = (Screen.Height - Height) / 2 ' et en hauteur
End Sub

Private Sub valider_Click()
Dim Rthradmax As Variant
Tjmax = 125
Tradmax = 100

If Val(TexteIntensite.Text) > Adodc1.Recordset.Fields("Imax") Then ' Test de l'intensité
Y = MsgBox("Choisissez un relais de calibre supérieur")
'Left = (Screen.Width - Width) / 2 ' on centre
'Top = (Screen.Height - Height) / 2 ' et en hauteur
Exit Sub
Else

If Val(TexteTemperature.Text) > 100 Then ' Test de la temprature
Y = MsgBox("La Tempérture choisie dépasse la température d'utilisation")
'Left = (Screen.Width - Width) / 2 ' on centre
'Top = (Screen.Height - Height) / 2 ' et en hauteur
Exit Sub
Else
' Calcul de la puissance dissipée par le relais statique
Pd = Val(TexteIntensite.Text) * Adodc1.Recordset.Fields("Valpd1") + Val(TexteIntensite.Text) * Val(TexteIntensite.Text) * Adodc1.Recordset.Fields("Valpd2")
If Pd 0 Or TexteIntensite.Text "" Then ' Test si Pd = 0
Erreur1 = MsgBox("Veuillez entrer les valeurs de température et d'intensité")
'Left = (Screen.Width - Width) / 2 ' on centre
'Top = (Screen.Height - Height) / 2 ' et en hauteur
Exit Sub
Else

' Calcul de Rthradmax
Rthradmax = (((Tjmax - Val(TexteTemperature.Text)) / Pd) - (Adodc1.Recordset.Fields("Rthjc") + 0.1))

E = MsgBox("La puissance dissipée est de : " & Pd) ' Affichage de la puissance dissipée
'Left = (Screen.Width - Width) / 2 ' on centre
'Top = (Screen.Height - Height) / 2 ' ' et en hauteur

E = MsgBox("La resistance thermique du dissipateur est : " & Rthradmax) ' Affichage de Rthradmax
'Left = (Screen.Width - Width) / 2 ' on centre
'Top = (Screen.Height - Height) / 2 ' ' et en hauteur

Tradmaxcalc = (Rthradmax * Pd) + Val(TexteTemperature.Text) ' Calcul de Tradmax pour verifier si Rthradmax est ok ou pas

If Tradmaxcalc > Tradmax Then ' Test si Tradmaxcalc > 100°C (soit Tradmax)
Rthrad = ((Tradmax - Val(TexteTemperature.Text)) / Pd) ' Si c'est le cas on re-calcul avec Tradmax=100°C et non Tjamx=125°C
E = MsgBox("La nouvelle resistance thermique du dissipateur est : " & Rthrad) 'Affichage de la nouvelle Rthrad
'Left = (Screen.Width - Width) / 2
'Top = (Screen.Height - Height) / 2
Else ' Si c'est pas le cas on prend Rthrad=Rthradmax pour choisir le dissipateur
Rthrad = Rthradmax
End If
' Choix du dissipateur
If Rthrad >= 0.3 And Rthrad < 0.55 Then
TexteReferenceRadiateur.Text = " WF031100 "
TextDesignationrad.Text = "Rad. DIN 0,3 °c/W Ventilé pour SO/SV8/SVT/SV9/SG"
Picture1.Picture = LoadPicture("WF031100.jpg")
Else
If Rthrad >= 0.55 And Rthrad < 0.75 Then
TexteReferenceRadiateur.Text = " WF050000 "
TextDesignationrad.Text = "Rad. 0,55 °c/W pour SO/SV8/SVT/SV9/SG"
Picture1.Picture = LoadPicture("WF050000.jpg")
Else
If Rthrad >= 0.75 And Rthrad < 0.9 Then
TexteReferenceRadiateur.Text = " WF070000 "
TextDesignationrad.Text = "Rad. 0,75 °c/W pour SO/SV8/SVT/SV9/SG"
Picture1.Picture = LoadPicture("WF070000.jpg")
Else
If Rthrad >= 0.9 And Rthrad < 1.1 Then
TexteReferenceRadiateur.Text = "WF115100 "
TextDesignationrad.Text = "Rad. DIN 0,9°c/W pour SO/SV8/SVT/SV9/SG"
Picture1.Picture = LoadPicture("WF115100.jpg")
Else
If Rthrad >= 1.1 And Rthrad < 1.2 Then
TexteReferenceRadiateur.Text = " WF131100 "
TextDesignationrad.Text = "Rad. DIN 1,1°c/W pour SO/SV8"
Picture1.Picture = LoadPicture("WF131100.jpg")
Else
If Rthrad >= 1.2 And Rthrad < 1.3 Then
TexteReferenceRadiateur.Text = "WF121000"
TextDesignationrad.Text = "Rad. DIN 1,2 °c/W pour SO/SV8/SVT/SV9/SG"
Picture1.Picture = LoadPicture("WF121000.jpg")
Else
If Rthrad >= 1.3 And Rthrad < 1.5 Then
TexteReferenceRadiateur.Text = " WF129100"
TextDesignationrad.Text = "Rad. DIN 1,29 °c/W pour SO/SV8"
Picture1.Picture = LoadPicture("WF129100.jpg")
Else
If Rthrad >= 1.5 And Rthrad < 1.95 Then
TexteReferenceRadiateur.Text = " WF141100"
TextDesignationrad.Text = "Rad. DIN 1,5°c/W pour SO/SV8"
Picture1.Picture = LoadPicture("WF141100.jpg")
Else
If Rthrad >= 1.95 And Rthrad < 2.2 Then
TexteReferenceRadiateur.Text = " WF191100"
TextDesignationrad.Text = "Rad. DIN 1,91 °c/W pour SO/SV8"
Picture1.Picture = LoadPicture("WF191100.jpg")
Else
If Rthrad >= 2.2 And Rthrad < 2.4 Then
TexteReferenceRadiateur.Text = " WF262100 ou WF151200"
TextDesignationrad.Text = "Rad. DIN 2,2°c/W pour SO/SV"
Picture1.Picture = LoadPicture("WF262100.jpg")
Else
If Rthrad >= 2.4 And Rthrad < 6 Then
TexteReferenceRadiateur.Text = " WF152100 "
TextDesignationrad.Text = "Rad. DIN 2,1-2,6 °c/W pour SO/SV8"
Picture1.Picture = LoadPicture("WF152100.jpg")
Else
If Rthrad > 6 Then
TexteReferenceRadiateur.Text = "Pas besoin de dissipateur"
TextDesignationrad.Text = "Relais à monter sur rail DIN ou fond d'armoire"
Else
If Rthrad < 0.3 Then
TexteReferenceRadiateur.Text = "Rth<0.3 Choisissez un relais de calibre supérieur"
Else

Exit Sub
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub

-=[s]=-=[k]=-=[Y]=-=[z]=-=[o]=-

-=[s]=-=[k]=-=[Y]=-=[z]=-=[o]=-

1 réponse

cs_ITALIA Messages postés 2169 Date d'inscription vendredi 20 avril 2001 Statut Membre Dernière intervention 30 juin 2009 9
3 sept. 2004 à 16:45
Protéges ta Base par Mot de Passe....j'en Conviens si c'est de l'access...le mot de Passe se trouve vite..Mais Bon !!

Pour l'image il y a Possibilité de l'enregistrer dans ta Base en tant qu'Objet OLE ....mais fortement deconseillé...

--> STOCKER IMAGE DANS BASE <--

It@li@
0
Rejoignez-nous