Advertisement

09.24.2007 at 10:10AM PDT, ID: 22848846
[x]
Attachment Details

"Could not delete from specified tables" MS Access with ODBC linked tables

Asked by HRISDeveloper in Microsoft Access Database, VB Database Programming, SQL Query Syntax

Tags: delete, access, from, specified, table

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!txtSSN.SetFocus
    strEmpNumber = Me!EmployeeInfo.Form!txtSSN.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
 
Loading Advertisement...
 
[+][-]09.24.2007 at 10:22AM PDT, ID: 19949942

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.24.2007 at 10:29AM PDT, ID: 19949997

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.24.2007 at 10:56AM PDT, ID: 19950214

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Access Database, VB Database Programming, SQL Query Syntax
Tags: delete, access, from, specified, table
Sign Up Now!
Solution Provided By: ICINTRACOM
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.24.2007 at 12:21PM PDT, ID: 19950971

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.24.2007 at 12:30PM PDT, ID: 19951050

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.24.2007 at 01:44PM PDT, ID: 19951638

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.24.2007 at 02:26PM PDT, ID: 19951918

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628