I have an SQL database on SQL Server Enterprise Manager. I also have an access data base with ODBC links to the tables in the databasse.
On Friday, we moved it from one server to another server.
Now, when I try to delete an employee, it no longer works, even though I'm an owner on the SQL table side.
Code:
Private Sub btDelete_Click()
Me!EmployeeInfo.Form!txtSS
N.SetFocus
strEmpNumber = Me!EmployeeInfo.Form!txtSS
N.Text
Me.cboYear.SetFocus
strYear = Me.cboYear.Text
strYN = MsgBox("Are you sure you want to delete the currently selected employee?" & vbNewLine & vbNewLine & _
" Employee Number: " & strEmpNumber & vbNewLine & _
" Process Year: " & strYear, vbExclamation + vbYesNo + vbDefaultButton2, "Delete Employee?")
If strYN = vbYes Then
DoCmd.SetWarnings 0
strSQL = "DELETE * FROM tblGoals WHERE Process_Year=" & strYear & " AND Employee_Number='" & strEmpNumber & "'"
DoCmd.RunSQL strSQL
strSQL = "DELETE * FROM tblEmployee WHERE Process_Year=" & strYear & " AND Employee_Number='" & strEmpNumber & "'"
MsgBox (strSQL)
DoCmd.RunSQL strSQL
DoCmd.SetWarnings 1
RequeryEmpInfo
End If
End Sub
Error is "Could not delete from specified tables."
When I go to the actual ODBC linked table in Access, I can't delete it there either."Records not deleted. Data is read-only." I can delete the row on the SQL table in enterprise manager.
Any ideas?
Start Free Trial