Hallo bin wieder da ^^ Das mal mit einer frage über VB 2008
Ich wollte eine
Mysql verbindung aufbauen. Aber iwie möchte er script meinen
Mysql befehl nicht ausführen. Was habe ich falsch gemacht
Code:
Public Class Form1
Dim conn As New MySqlConnection("server=
localhost;user id=root; password=; port=3306; database=
db; pooling=false")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
conn.Open()
Catch myerror As MySqlException
MessageBox.Show("Fehler beim Verbinden")
Finally
conn.Dispose()
starting()
End Try
End Sub
''''''''''
Mysql query Function'''''''''''
Function mysql_query(ByVal
query As String) As Boolean
Dim myadapter As New MySqlDataAdapter
Dim sqlquary =
query
Dim command As New MySqlCommand
command.Connection = conn
command.CommandText = sqlquary
myadapter.SelectCommand = command
End Function
Private Sub starting()
mysql_query("UPDATE visitors_now SET
ip = 'Test...'")
End Sub
End Class