1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Imports System.Data
Imports ADODB
Imports System.Data.OleDb
Public Class ClsDonneesEleves
Public Sub New()
CnDonnees = New ADODB.Connection
CnDonnees.ConnectionString = "Provider=Microsoft.jet.oledb.4.0; data source=" & My.Application.Info.DirectoryPath & "\compétences.mdb"
Try
CnDonnees.Open()
Catch ex As Exception
MsgBox(" L'érreure suivante a été rencontrée : " & ex.Message, MsgBoxStyle.Critical, "Correction")
End Try
End Sub
Public Sub ChercherDonneesEleves()
StrSql = "select * from candidat where (((Candidat.codecand)=?))"
Try
CmdDonnees = New Command
CmdDonnees.ActiveConnection = CnDonnees
CmdDonnees.prepared=true
Prm1 = CmdDonnees.CreateParameter("Prm1", ADODB.DataTypeEnum.adBSTR)
CmdDonnees.Parameters.Append(Prm1)
Prm1.Value = MonCodeNational
Prm1.Size = Len(MonCodeNational)
CmdDonnees.CommandText = StrSql
CmdDonnees.CommandType = CommandType.Text
RsDonnees = New ADODB.Recordset
RsDonnees.Open(StrSql, , ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
Catch ex As Exception
MsgBox(ex)
End Try
End Sub
End Class |