Vulcan1500
Registered User.
- Local time
- Today, 22:03
- Joined
- Nov 13, 2007
- Messages
- 143
Due to an unforseen modification in my database, I need to add a column to a table of the linked backend. I do not prefer users to modify this table, but try to do this with code in the frontend of the release that comes with the modification. For me it seems impossible to add a variable as an integer to this table. MS Access returns an error as soon as I try to add the column with db.Execute (strSQL) in the following code:
MS Access gives error 3211 due to it could not lock MyTable being in use by another person or process.
Code:
[FONT=Arial][COLOR=black]Dim db As DAO.Database[/COLOR][/FONT]
[FONT=Arial][COLOR=black]Dim rs As DAO.Recordset[/COLOR][/FONT]
[FONT=Arial][COLOR=black]Dim strSQL As String[/COLOR][/FONT]
[FONT=Arial][COLOR=black]Set db = OpenDatabase("C:\Aalles\My_backend.mdb")[/COLOR][/FONT]
[FONT=Arial][COLOR=black]strSQL = "ALTER TABLE MyTable " & _[/COLOR][/FONT]
[FONT=Arial][COLOR=black] "ADD COLUMN BackupAantal Integer;"[/COLOR][/FONT]
[FONT=Arial][COLOR=black]db.Execute (strSQL)[/COLOR][/FONT]
MS Access gives error 3211 due to it could not lock MyTable being in use by another person or process.