tif27940
Messages postés74Date d'inscriptionlundi 24 janvier 2011StatutMembreDernière intervention21 février 2012
-
30 déc. 2011 à 14:40
tif27940
Messages postés74Date d'inscriptionlundi 24 janvier 2011StatutMembreDernière intervention21 février 2012
-
3 janv. 2012 à 09:43
Dim nom As String
Dim pnom As String
Dim civ As String
Dim tel As String
Dim etab As String
' Lecture du fichier de configuration XML
Dim i As Integer
Dim startupPath As String
Dim dsConfig As New DataSet
Dim dsCommande As DataSet = New DataSet()
Dim cSql As String
startupPath = Assembly.GetExecutingAssembly().GetName().CodeBase
startupPath = Path.GetDirectoryName(startupPath)
dsConfig.ReadXml(startupPath + "" + "config.xml")
If dsConfig.Tables.Count = 2 Then
With dsConfig.Tables(0).Rows(0)
configGene.databasemaillard = .Item("DATABASE-MAILLARD")
configGene.smtphost = .Item("smtp.host")
configGene.smtpport = .Item("smtp.port")
End With
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Try
'requete 6 mois''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
cSql "select distinct Contact.Nom, Contact.Prenom, Contact.Civilite, Adresse.Tel, Etablissement.Etablissement from Contact, Adr_Contact, Adresse, Etablissement where Contact.Contact_Id Adr_Contact.Contact_Id and Adr_Contact.Adresse_Id=Adresse.Adresse_Id and Adresse.Adresse_Id=Etablissement.Adresse_ID and (Contact.Fonc_Id=39 or Contact.Fonc_Id=151 or Contact.Fonc_Id=108) and Contact.Contact_Id NOT IN (Select Contact_Id from Dossier where Dte_Ouverture <= dateadd(month,-6,getdate()) and Contact_Id is not null ) and Nom < > '(Décédé )' and Dte_Inactif IS NULL order by Contact.Nom, Contact.Prenom asc; "
Dim adapter = New OleDb.OleDbDataAdapter(cSql, configGene.databasemaillard)
adapter.Fill(dsCommande, "list_contact")
For i = 0 To dsCommande.Tables(0).Rows.Count - 1
nom = Trim$(dsCommande.Tables(0).Rows(i).Item(0).ToString)
pnom = Trim$(dsCommande.Tables(0).Rows(i).Item(1).ToString)
civ = Trim$(dsCommande.Tables(0).Rows(i).Item(2).ToString)
tel = Trim$(dsCommande.Tables(0).Rows(i).Item(3).ToString)
etab = Trim$(dsCommande.Tables(0).Rows(i).Item(4).ToString)
results = results & " " & civ & " " & nom & " " & pnom & "
Téléphone : " & tel & "
Etablissement : " & etab & "
"
Next
Dim cMsg As String
cMsg = ""
cMsg = "Bonjour,
"
cMsg = cMsg & "Voici les notaires inactifs depuis 6 mois"
cMsg = cMsg & "
" & results
EnvoiMail("tgauthier@ciage.fr", "Etude maillard : Notaire inactif depuis 6 mois", cMsg, "tgauthier@ciage.fr")
Console.WriteLine("Notaire inactif depuis 6 mois envoyés")
Catch
Console.WriteLine("Erreur dans le traitement : " & ErrorToString())
End Try
le problème est que il va bien jusqu’à la ligne "adapter.Fill(dsCommande, "list_contact")" mais ensuite il va direct a "Console.WriteLine("Erreur dans le traitement : " & ErrorToString()" et me dit "Aucune message d'erreur disponible, code de résultat : DB_E_ERRORSOCCURRED(0x80040E21)."
NHenry
Messages postés15048Date d'inscriptionvendredi 14 mars 2003StatutModérateurDernière intervention19 mars 2023156 30 déc. 2011 à 19:26
Bonjour,
Et si à la place de :
Catch
Console.WriteLine("Erreur dans le traitement : " & ErrorToString())
End Try
Tu mets :
Catch Ex As Exception
Console.WriteLine("Erreur dans le traitement : " & Ex.ToString)
End Try
ça donne quoi ?
---------------------------------------------------------------------
[list=ordered][*]Pour poser correctement une question et optimiser vos chances d'obtenir des réponses, pensez à lire le règlement CS, ce lien ou encore celui-ci[*]Quand vous postez un code, merci d'utiliser la coloration syntaxique (3ième icône en partant de la droite : )
[*]Si votre problème est résolu (et uniquement si c'est le cas), pensez à mettre "Réponse acceptée" sur le ou les messages qui vous ont aidés./list ---
Mon site