Hello:
i am using dao to execute a couple of querys as a transaction.
im using querydef to delete some records from a table that has the following info:
year number
day number
month number
i have the whole 2001 year and the whole 2002.
my query is: "delete * from table where year=[anio]"
when i exexute this query, it does not delete the first day of january of 2002...
whats wrong???
heres the codeim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim qdf2 As DAO.QueryDef
Dim wsp As DAO.Workspace
DoCmd.SetWarnings False
Set wsp = DBEngine.Workspaces(0)
wsp.BeginTrans
Set db = CurrentDb
Set qdf = db.querydefs("c_delete"
qdf.Parameters("ano" = Me.ca_anio
'qdf.Parameters("ano2" = Me.ca_anio
qdf.Execute dbFailOnError
Set qdf = db.querydefs("c_iniferiados"
qdf.Execute dbFailOnError
Set qdf = db.querydefs("c_initnoct"
qdf.Execute dbFailOnError
Set qdf = db.querydefs("c_inidiast"
qdf.Execute dbFailOnError
wsp.CommitTrans
DoCmd.SetWarnings True
MsgBox "El calendario ha sido eliminado", vbInformation
Set qdf = Nothing
Set db = Nothing
Set wsp = Nothing
DoCmd.Close acForm, Me.Name, acSaveNo 'para cerrar la forma
i am using dao to execute a couple of querys as a transaction.
im using querydef to delete some records from a table that has the following info:
year number
day number
month number
i have the whole 2001 year and the whole 2002.
my query is: "delete * from table where year=[anio]"
when i exexute this query, it does not delete the first day of january of 2002...
whats wrong???
heres the codeim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim qdf2 As DAO.QueryDef
Dim wsp As DAO.Workspace
DoCmd.SetWarnings False
Set wsp = DBEngine.Workspaces(0)
wsp.BeginTrans
Set db = CurrentDb
Set qdf = db.querydefs("c_delete"
qdf.Parameters("ano" = Me.ca_anio
'qdf.Parameters("ano2" = Me.ca_anio
qdf.Execute dbFailOnError
Set qdf = db.querydefs("c_iniferiados"
qdf.Execute dbFailOnError
Set qdf = db.querydefs("c_initnoct"
qdf.Execute dbFailOnError
Set qdf = db.querydefs("c_inidiast"
qdf.Execute dbFailOnError
wsp.CommitTrans
DoCmd.SetWarnings True
MsgBox "El calendario ha sido eliminado", vbInformation
Set qdf = Nothing
Set db = Nothing
Set wsp = Nothing
DoCmd.Close acForm, Me.Name, acSaveNo 'para cerrar la forma