midgorn
Messages postés1Date d'inscriptionlundi 23 octobre 2000StatutMembreDernière intervention12 septembre 2003
-
12 sept. 2003 à 13:43
nhervagault
Messages postés6063Date d'inscriptiondimanche 13 avril 2003StatutMembreDernière intervention15 juillet 2011
-
12 sept. 2003 à 21:53
bonjour, j essaye d'acceder a une base mysql avec vb.
j'utilise l'api mysql.
apparemment la connection se passe bien , mais au moment d'executer une requete, la connection est perdu, j obtiens le message d'erreur "MySql server gone away'
Si qqun pouvait m'aider ça serait sympa :)
voici mon code :
Dim pMySQL As Long
Dim myErrorCode As Long
Dim pMyErrorMsg As Long
Dim myErrorMsg As String
Dim pMyROW As Long, myROW As Long, pMyRES As Long, i As Long
pMySQL = mysql_init(0)
If mysql_real_connect(pMySQL, "localhost", "moto", "", "root", 0, "0", 0) = 0 Then
If (mysql_query(pMySQL, "SELECT * FROM test") <> 0) Then
MsgBox "Instruction INSERT a echouer"
pMyErrorMsg = mysql_error(pMySQL)
myErrorMsg = CopieChaine(pMyErrorMsg)
MsgBox myErrorMsg
Else
MsgBox "Instruction INSERT a reussi"
End If
Else
MsgBox "connexion echouer"
End If
mysql_close (pMySQL)