|
|
Удаление Поля из Таблицы
Public Sub DelTableField(sDBPath$, sTableName$, sFieldName$)
Dim s$
Dim dbe As DAO.DBEngine
Dim dbs As DAO.Database
On Error GoTo DelTableField_Err
Set dbe = CreateObject("DAO.DBEngine.120")
Set dbs = dbe.OpenDatabase(sDBPath)
s = "ALTER TABLE " & sTableName & " DROP COLUMN " & sFieldName
dbs.Execute s
DelTableField_Bye:
Set dbe = Nothing
Set dbs = Nothing
Exit Sub
DelTableField_Err:
MsgBox "Ошибка " & Err.Number & vbCrLf & Err.Description & vbCrLf & "в процедуре: DelTableField", vbCritical, "Error"
Resume DelTableField_Bye
End Sub
Public Sub DelTableField(sTableName$, sFieldName$)
Dim s$
On Error GoTo DelTableField_Err
s = "ALTER TABLE " & sTableName & " DROP COLUMN " & sFieldName
CurrentDb.Execute s
DelTableField_Bye:
Exit Sub
DelTableField_Err:
MsgBox "Ошибка " & Err.Number & vbCrLf & Err.Description & vbCrLf & "в процедуре: DelTableField", vbCritical, "Error"
Resume DelTableField_Bye
End Sub
|
|