Hi there. I have a simple Access database with names and numbers.
I'm trying to add another entry through vb6 but i get a SYNTAX ERROR in INSERT INTO statement.
Please help. What am i doing wrong?
Private Sub cmdAdd_Click()
Dim sql, nam, num As String
nam = InputBox("Enter Name:", "Name")
num = InputBox("Enter Number:", "Number")
sql = "INSERT INTO Contacts (Name, Number) VALUES " & nam & ", " & num
Call con.Execute(sql )
End Sub
Email
I'm trying to add another entry through vb6 but i get a SYNTAX ERROR in INSERT INTO statement.
Please help. What am i doing wrong?
Private Sub cmdAdd_Click()
Dim sql, nam, num As String
nam = InputBox("Enter Name:", "Name")
num = InputBox("Enter Number:", "Number")
sql = "INSERT INTO Contacts (Name, Number) VALUES " & nam & ", " & num
Call con.Execute(sql )
End Sub
Comment