Skip to content

Instantly share code, notes, and snippets.

@AuroraNorthernQuarter
Created July 3, 2020 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AuroraNorthernQuarter/0eb129a8499fcf2468da70796a4054ae to your computer and use it in GitHub Desktop.
Save AuroraNorthernQuarter/0eb129a8499fcf2468da70796a4054ae to your computer and use it in GitHub Desktop.
private const aquarium_num as string = "フォーム1"
private accounting as collection
if not Water() then GoTo exit_proc
private function Water() as boolean
const animal_num as string = "Water"
dim tSQL as string
dim aquarium as dao.recordset
on error GoTo err_proc
Water = false
tSQL = ""
tSQL = "select 水族館ID,都道府県ID from リアルタイム情報"
tSQL = tSQL & "where 集計日 = " & clng(format(me.txtdate.value,"yyyymmdd"))
set aquarium = dbinfo.OpenRecordset(tSQL,dbOpenDynaset)
with aquarium
do until .eof
accounting.add true, .fields(0).value & "#" & .fields(1).value
.movenext
loop
end with
set aquarium = nothing
Water = true
exit function
err_proc:
if not aquarium is nothing then set aquarium = nothing
call showmsg(aquarium_num,animal_num,err_description)
end function
exit_proc
if not aquarium is nothing then set aquarium = nothing
if not accounting is nothing then set accounting = nothing
end sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment