dynamictiger
Technical User
I have the following code in my application. The second set of functions dpsOkNew, and NoNew according to microsoft enable me to grant full permissions on the table for the duration of dpsUpdateTable.
However, every time dpsUpdateTable runs I am getting a message that I do not have permission blah blah.
Function dpsUpdateTable()
On Error GoTo Err_ProcedureName
Call dps_OKNew
Set db = CurrentDb
Set rs = db.OpenRecordset("tblDateFlagged", dbOpenDynaset)
If rs.BOF = False Then
rs.MoveFirst
Do While rs.Fields("MeDate" <= Date
rs.Edit
rs.Fields("FlagDate" = True
rs.Update
rs.MoveNext
Loop
End If
Exit_ProcedureName:
Call dps_NoNew
Exit Function
Err_ProcedureName:
MsgBox Err.Description, vbOKOnly + vbCritical, "Function Update Table"
Resume Exit_ProcedureName
End Function
Private Function dps_OKNew()
Dim db As Database
Dim con As Container
Set db = DBEngine(0)(0)
Set con = db.Containers("Tables"
con.UserName = "PoolShop"
con.Permissions = con.Permissions Or DB_SEC_CREATE
End Function
Private Function dps_NoNew()
Dim db As Database
Dim con As Container
Set db = DBEngine(0)(0)
Set con = db.Containers("Tables"
con.UserName = "PoolShop"
con.Permissions = con.Permissions And Not DB_SEC_CREATE
End Function
However, every time dpsUpdateTable runs I am getting a message that I do not have permission blah blah.
Function dpsUpdateTable()
On Error GoTo Err_ProcedureName
Call dps_OKNew
Set db = CurrentDb
Set rs = db.OpenRecordset("tblDateFlagged", dbOpenDynaset)
If rs.BOF = False Then
rs.MoveFirst
Do While rs.Fields("MeDate" <= Date
rs.Edit
rs.Fields("FlagDate" = True
rs.Update
rs.MoveNext
Loop
End If
Exit_ProcedureName:
Call dps_NoNew
Exit Function
Err_ProcedureName:
MsgBox Err.Description, vbOKOnly + vbCritical, "Function Update Table"
Resume Exit_ProcedureName
End Function
Private Function dps_OKNew()
Dim db As Database
Dim con As Container
Set db = DBEngine(0)(0)
Set con = db.Containers("Tables"
con.UserName = "PoolShop"
con.Permissions = con.Permissions Or DB_SEC_CREATE
End Function
Private Function dps_NoNew()
Dim db As Database
Dim con As Container
Set db = DBEngine(0)(0)
Set con = db.Containers("Tables"
con.UserName = "PoolShop"
con.Permissions = con.Permissions And Not DB_SEC_CREATE
End Function