bonjour

je développe une petite application se connectant à une base MySQL et affichant les données d'une table de test.
pour ce faire, j'ai utilisé Virtual PC 2007 pour créer un pc virtuel XP auquel j'ai ajouté wampserver 2.0h. j'ai accès à tous mes projets de sites internet depuis n'importe ou sur le réseau. j'héberge mon pc virtuel sur le meme pc que vb.net. Lorsque que je tente de me connecter à la base MySQL via mon appli vb.net, j'ai le message d'erreur suivant : "Unable to connect to any of the specified MySQL hosts". l'adresse ip et la base sont les bons, l'utilisateur et son mot de passe existent (différents du root)

j'ai l'impression que le problème vient du fait que l'appli vb ne trouve pas wamp. j'ai fait quelques recherches sur google mais pas de problemes similaires au mien. quelqu'un aurait il une solution ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
39
40
41
42
43
Imports MySql.Data.MySqlClient
 
Public Class Form1
    Dim oConn As New MySqlConnection
    Dim IP, DBName, UserName, UserPassword As String
 
    Private Sub B_Connect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B_Connect.Click
        oConn.ConnectionString = "Server=" & IP & ";Database=" & DBName & ";Uid=" & UserName & ";Pwd=" & UserPassword & ";"
        'Server=localhost;Database=MaBase;Uid=user;Pwd=mdp;
        MsgBox("Server=" & IP & ";Database=" & DBName & ";Uid=" & UserName & ";Pwd=" & UserPassword & ";")
 
        Try
            oConn.Open()
 
            Dim myCommand As New MySqlCommand
            Dim MyAdapt As New MySqlDataAdapter
            Dim myDataTable As New DataTable
            Dim strQuery As String
 
            strQuery = "SELECT Libelle FROM users"
 
            myCommand.Connection = oConn
            myCommand.CommandText = strQuery
 
            MyAdapt.SelectCommand = myCommand
            'MyAdapt.Fill(myDataTable)
 
            'For i As Integer = 0 To myDataTable.Rows.Count - 1
            '    MsgBox(myDataTable.Rows(i)("monChamp").ToString)
            'Next
        Catch ex As Exception
            DBStatus.Text = ex.Message
        End Try
 
    End Sub
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        IP = BoxIP.Text
        DBName = BoxDBName.Text
        UserName = BoxUserName.Text
        Userpassword = BoxUserPassword.Text
    End Sub
End Class
merci d'avance