Hi, I have an Access Database that is linked to Oracle 11G tables. I have a vba Sub that is trying to delete selected data from the Oracle table. I am getting an error that Microsoft Access Database engine cannot find the input table or query.
Big Picture: This database is used by multiple users. We want users to be able to update data in the oracle table with the minimum of probablity of running into record locking errors. We are selecting data based on each users criteria and setting it into a temporary Access Table that is uniquely identified based on their selection (Example: they select all records that are associated with SBPRJTRPTGRPID so we name the temp table based on the SBPRJTRPTGRPID) . The user makes their updates in an Access Form linking to the temp table. When they close the Form we want Access to Delete the records in the Oracle table and replace them with the records from the temporary table that the user has updated. Then Access will delete the temporary table and close the Form.
My problem is that when the system goes to delete the records it does not recognize the Linked Oracle table. I know that the table name is correct. I think I need to do something with the TableDef.Connec t but, I am not sure how to go about this. When I do a debug.print on TableDef.Connec t I get the following information: ODBC;DSN=TRNDEV ;UID=TRN_FMDB;P WD=*****; Can you help? Below is the Code for the Delete. It fails on the Open Recordset.
The full code of the Sub contains the Adodb.Connectio n and Path prior to this action and opens another recordset so I know there are no issues there.
Thank you for looking at this with me.
Big Picture: This database is used by multiple users. We want users to be able to update data in the oracle table with the minimum of probablity of running into record locking errors. We are selecting data based on each users criteria and setting it into a temporary Access Table that is uniquely identified based on their selection (Example: they select all records that are associated with SBPRJTRPTGRPID so we name the temp table based on the SBPRJTRPTGRPID) . The user makes their updates in an Access Form linking to the temp table. When they close the Form we want Access to Delete the records in the Oracle table and replace them with the records from the temporary table that the user has updated. Then Access will delete the temporary table and close the Form.
My problem is that when the system goes to delete the records it does not recognize the Linked Oracle table. I know that the table name is correct. I think I need to do something with the TableDef.Connec t but, I am not sure how to go about this. When I do a debug.print on TableDef.Connec t I get the following information: ODBC;DSN=TRNDEV ;UID=TRN_FMDB;P WD=*****; Can you help? Below is the Code for the Delete. It fails on the Open Recordset.
Code:
Dim dblSbprjtGrp As Double Dim sSQL2 As String Dim rs2 As ADODB.Recordset dblSbprjtGrp = Me.SBPRJTRPTGRPID.Value 'Replace the Subprojects in TBLMNGRSBPRJTRPTDETAILS with the updated Subproject list on the temporary table sSQL2 = " DELETE * FROM TBLMNGRSBRPRJTRPTDETAILS WHERE SUBPRJTRPTGRPID = " & dblSbprjtGrp Debug.Print sSQL2 'Deletes records from TBLMNGRSBPRJTRPTDETAILS Set rs2 = New ADODB.Recordset rs2.Open sSQL2, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Thank you for looking at this with me.
Comment