none
Data type mismatch in criteria expression. MS Access VB RRS feed

  • Discussion générale

  • Bonjour, aider moi pour résoudre ce pb 

    Public Class Form2
        Sub fillcombo()
            strsql = "select nom_p from port "
            Dim acscmd As New OleDb.OleDbCommand
            acscmd.CommandText = strsql
            acscmd.Connection = acsconn
            acsdr = acscmd.ExecuteReader
            While (acsdr.Read())
                ComboBox1.Items.Add(acsdr("nom_p"))
            End While
            acscmd.Dispose()
            acsdr.Close()
        End Sub
    
        Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Module1.connect()
            Me.fillcombo()
        End Sub
    
    
        Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
            strsql = "select nom from fichier where fichier.code_f = jointe.code_f and nom_p='" & ComboBox1.Text & "'  "
            Dim acscmd As New OleDb.OleDbCommand
            acscmd.CommandText = strsql
            acscmd.Connection = acsconn
            acsdr = acscmd.ExecuteReader     il donne ce msg à cette position "Data type mismatch in criteria expression" 
            If (acsdr.Read() = True) Then
                TextBox1.Text = (acsdr("nom"))
            End If
            acscmd.Dispose()
            acsdr.Close()
        End Sub
    End Class

    j'ai une relation (n-n) entre port et fichier 

     
    • Type modifié Aurel Bera vendredi 13 juin 2014 06:10 disc
    lundi 9 juin 2014 22:49

Toutes les réponses