Hi,
I've done extensive searching over the last hour and I can't seem to find what i'm after, or if it's possibly the way i'm doing it. I want to take the output of a text control and insert this value into a table. I have been reading up on SQL injection prevention so I'm going to use parameters in my SQL statement instead.
I was trying to keep it simple by just issuing the SQL statement straight to the database. I have an auto increment primary key, so all i'm needing to insert is the job title. I'm struggling to find how to create my parameter, "JobTitle" though...
I've done extensive searching over the last hour and I can't seem to find what i'm after, or if it's possibly the way i'm doing it. I want to take the output of a text control and insert this value into a table. I have been reading up on SQL injection prevention so I'm going to use parameters in my SQL statement instead.
Code:
Private Sub Command7_Click()
Dim sqlString As String
sqlString = "INSERT INTO dbo_title(Title_JobTitle) VALUES(@JobTitle)"
CurrentDb.Execute sqlString
End Sub
I was trying to keep it simple by just issuing the SQL statement straight to the database. I have an auto increment primary key, so all i'm needing to insert is the job title. I'm struggling to find how to create my parameter, "JobTitle" though...