Hi. I'm successfully adding Last Names to my List and Database but when I come across a Last or First Name with the Character ' in it, It tends to error out. Here's my code for the SQL Statement.
vb Code:
SQL = "INSERT INTO [Course_" & CourseName & "] (LastName, FirstName, Gender, HomeRoom, StudentNumber) VALUES ('" & DR("Last Name") & "','" & DR("First Name") & "','" & TempGender & "','" & DR("Home Room/Form") & "','" & DR("Special Use") & "')" Command = New OleDbCommand(SQL, Connection) Command.Connection.Open() Command.ExecuteNonQuery() Command.Connection.Close()




Reply With Quote