Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Error in with MYSql

lutonianlutonian Member Posts: 2
Hi all,

I do not have to much experience in I am doing small application to practice.

In this case I am creating a VB application conneting to a MYSQL Database.

The problem I have is when I try to make a new register into the DDBB, I recieve a syntaxis error.

INSERT INTO Libros(Titulo,Desc) VALUES ('" & Titulo_text.Text & "', '" & Desc_text.Text & "')

However if I use the command into mysql server it works fine.

INSERT INTO Libros(Title,Desc) VALUES ()

Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click

If sConnection.State = ConnectionState.Closed Then
sConnection.ConnectionString = "SERVER = my server; USERID = joserodriguezan; PASSWORD = Aberystwyth; DATABASE = Bibloteca;"
End If
strSQL = "INSERT INTO Libros(Title,Desc) VALUES ('" & Title_text.Text & "', '" & Desc_text.Text & "')"
Dim da As New MySqlDataAdapter(strSQL, sConnection)
Catch ex As Exception
End Try

Tittle_text.Text = ""
Desc_text.Text = ""
Class_combo.Text = ""
Date_text.Text = ""
Pres_text.Text = ""
Who_text.Text = ""
End Sub

Any knows how to resolve this problem?
Thank you.


Sign In or Register to comment.