Я не вижу, что не так с моим синтаксическим кодом оператора SQL здесь:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Using Con1 As New Odbc.OdbcConnection("Driver={MySQL ODBC 5.1 Driver};Server=127.0.0.1;Database=MyGame;User=root; Password=MyPasswordWhichIWontTellYou;")
Dim mInsertSQL As String
mInsertSQL = "INSERT INTO Accounts (Username,Password,Str,Int,Agi,Money) VALUES ('" & txtUser.Text & "','" & txtPass.Text & "'," & Int(txtStr.Text) & "," & Int(txtInt.Text) & "," & Int(txtAgi.Text) & ",0);"
Dim Cmd1 As New Odbc.OdbcCommand(mInsertSQL, Con1)
Try
Con1.Open()
Cmd1.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Using
End Sub
Просто для ясности фактический оператор вставки это с некоторыми данными:
"INSERT INTO Accounts (Username,Password,Str,Int,Agi,Money) VALUES ('MyUsername','MyPassword',0,0,0,0)"
ошибка:
ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.1.41]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Int,Agi,Money) VALUES ('MyUsername','MyPassword',0,0,0,0)' at line 1
Большое спасибо.