K
kfguardian
I am trying to set up a querydef to export a query. The set qdf statement
doesn't execute because mydb=nothing for some reason. I'm not real familiar
with doing the DAO vs ADO stuff so I'm not sure what I am missing. All
examples I have seen have nothing special in them?! This is an adp instead
of an mdb- does that matter??
Dim mydb As DAO.Database
Dim qdf As DAO.QueryDef
Set cnThisConnect = CurrentProject.Connection
strSQL = "SELECT * FROM tblInputData " _
& "WHERE (InputDate >= CONVERT(DATETIME, '" & datQueryStart
& "', 102)) AND" _
& " (InputDate < CONVERT(DATETIME, '" & ShiftEnd &
"', 102))"
rstNewInputData.Open strSQL, cnThisConnect, adOpenKeyset,
adLockOptimistic, adCmdText
Set mydb = CurrentDb()
Set qdf = CurrentDb.CreateQueryDef("ShiftReport", strSQL)
doesn't execute because mydb=nothing for some reason. I'm not real familiar
with doing the DAO vs ADO stuff so I'm not sure what I am missing. All
examples I have seen have nothing special in them?! This is an adp instead
of an mdb- does that matter??
Dim mydb As DAO.Database
Dim qdf As DAO.QueryDef
Set cnThisConnect = CurrentProject.Connection
strSQL = "SELECT * FROM tblInputData " _
& "WHERE (InputDate >= CONVERT(DATETIME, '" & datQueryStart
& "', 102)) AND" _
& " (InputDate < CONVERT(DATETIME, '" & ShiftEnd &
"', 102))"
rstNewInputData.Open strSQL, cnThisConnect, adOpenKeyset,
adLockOptimistic, adCmdText
Set mydb = CurrentDb()
Set qdf = CurrentDb.CreateQueryDef("ShiftReport", strSQL)