Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'Ouverture de la connexion en fonction du type demandé Accesss ou Mysql Dim oCon As ADODB.Connection ' Connexion vers la BD Dim Rs As ADODB.Recordset Dim strConnect As String ' Chaîne de connexion vers la BD Dim strSql As String Dim Couleur As Color Dim Choix_style As Integer Dim Num_terrain As String Dim pos_terrain As Integer Dim j As Integer Dim k As Integer ' Initialisation de la chaîne de connexion If Not Config.RdoBtn_aucun.Checked Then ' Initialisation de la chaîne de connexion If Config.RdoBtn_Mysql.Checked Then strConnect strConnect "DRIVER={MySQL ODBC 5.1 Driver};SERVER=localhost;DATABASE=Tournoi;PORT=3306;UID=root;PASSWORD=;OPTION=3;STMT=;" Else strConnect = "DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" & Application.StartupPath & "\tournoi.mdb" End If ' Initialisation de la connection oCon = New ADODB.Connection oCon.Open(strConnect) ' Initialisation d'une requête strSql = "select Num_match as num, terrain, etat from echeancier where etat<>0" Rs = New ADODB.Recordset Rs.Open(strSql, oCon) While Not Rs.EOF ....... ....... Rs.MoveNext() End While Rs.Close() 'Fermeture de la connexion oCon.Close() Rs = Nothing oCon = Nothing
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question