Un probleme au vb studio 2008

inespfe Messages postés 11 Date d'inscription vendredi 8 avril 2011 Statut Membre Dernière intervention 3 mai 2011 - 8 avril 2011 à 12:03
NHenry Messages postés 15114 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 4 mai 2024 - 8 avril 2011 à 23:59
inessss
jai un probleme au vb toujours afficher un msg d'exeption


merci d'avance cordialement

Private Sub cm2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cm2.SelectedIndexChanged
MyConnexion.Open()
Dim MyConnexion As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= e:\basedonnée.pfe.mdb;")

t3.Items.Clear()
Dim Mycommand2 As OleDbCommand = MyConnexion.CreateCommand()
Mycommand2.CommandText "SELECT contact.num_sec FROM section INNER JOIN contact ON section.num_sec contact.num_sec WHERE contact.ref_leonic='" & cm2.Text & "'"

Dim myReader2 As OleDbDataReader = Mycommand2.ExecuteReader()
// ici le message d'exeption

Do While myReader2.Read()
t3.Items.Add(myReader2.GetString(0))

Loop

myReader2.Close()
MyConnexion.Close()


End Sub

End Class

3 réponses

NHenry Messages postés 15114 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 4 mai 2024 159
8 avril 2011 à 20:00
Bonjour,

Quel message ?


Mon site
0
inespfe Messages postés 11 Date d'inscription vendredi 8 avril 2011 Statut Membre Dernière intervention 3 mai 2011
8 avril 2011 à 23:02
slt
ce sa le message qui l'affiche :

l'exception oldbexception n'a pas été geré
Échec de IErrorInfo.GetDescription avec E_FAIL(0x80004005).

> ici l'erreur qui l'affiche en cette phrase
// Dim myReader2 As OleDbDataReader = Mycommand2.ExecuteReader() //

mon programme:

Private Sub cm2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cm2.SelectedIndexChanged
MyConnexion.Open()
Dim MyConnexion As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= e:\basedonnée.pfe.mdb;")

t3.Items.Clear()
Dim Mycommand2 As OleDbCommand = MyConnexion.CreateCommand()
Mycommand2.CommandText "SELECT contact.num_sec FROM section INNER JOIN contact ON section.num_sec contact.num_sec WHERE contact.ref_leonic='" & cm2.Text & "'"

Dim myReader2 As OleDbDataReader = Mycommand2.ExecuteReader()

Do While myReader2.Read()
t3.Items.Add(myReader2.GetString(0))

Loop

myReader2.Close()
MyConnexion.Close()
0
NHenry Messages postés 15114 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 4 mai 2024 159
8 avril 2011 à 23:59
Bonjour,

Dsl, mais je pense que ta solution est dans cette page :
http://tutorials.aspfaq.com/8000xxxxx-errors/80004005-errors.html

Voir si tu as bien les droits d'accès au fichier, est-ce le nom à extension multiple qui le gène, ... ?

Mon site
0
Rejoignez-nous