ホーム

|

ソフトウェア

|

ダウンロード

|  

FAQ

|  

ご購入

UpgradeDBソースコード
 

Option Explicit


Private Sub Command1_Click()

Me.MousePointer = 11

Dim db As DAO.Database
Dim strSql As String
Dim strFilePath
Dim strDstPath1
Dim strDstPath2


Dim iVersion As Integer
Dim strVer As String

strVer = Trim(Combo1.Text)

If IsNumeric(strVer) Then

iVersion = CInt(strVer)
Else

MsgBox "バージョンを指定してください"
End

End If


strFilePath = App.Path & "\Nyushukka.mdb"
strDstPath1 = App.Path & "\Nyushukka.mdb.bak1"
strDstPath2 = App.Path & "\Nyushukka.mdb.bak2"

If Dir(strFilePath) <> "" Then

Dim ans

ans = MsgBox("アップグレードを開始しますか?", vbOKCancel)

If ans = vbOK Then

MsgBox "★★★★★ 完了のダイアログが表示するまで、このOKボタンを押した後は、絶対に、プログラムを終了しないで下さい ★★★★★"

If Dir(strDstPath1) <> "" Then

FileCopy strDstPath1, strDstPath2

End If

FileCopy strFilePath, strDstPath1

Else
End

End If

Else
MsgBox "データベースファイルが見つかりません"
End

End If


'12.0x

If iVersion <= 12 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "ALTER TABLE nyushukkamain ADD COLUMN yoyakuuketoridate DATETIME;"

db.Execute strSql

strSql = "ALTER TABLE kokyaku ADD COLUMN yuukoukigenn DATETIME;"

db.Execute strSql

db.Close

End If


'13.0x

If iVersion <= 13 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

db.TableDefs("kakeurishori").Fields("date").Name = "maindate"
db.TableDefs("kakeurishori").Fields.Refresh

db.TableDefs("nyushukkamain").Fields("date").Name = "maindate"
db.TableDefs("nyushukkamain").Fields.Refresh

db.TableDefs("seisann").Fields("_1yen").Name = "currency1yen"
db.TableDefs("seisann").Fields("_5yen").Name = "currency5yen"
db.TableDefs("seisann").Fields("_10yen").Name = "currency10yen"
db.TableDefs("seisann").Fields("_50yen").Name = "currency50yen"
db.TableDefs("seisann").Fields("_100yen").Name = "currency100yen"
db.TableDefs("seisann").Fields("_500yen").Name = "currency500yen"
db.TableDefs("seisann").Fields("_1000yen").Name = "currency1000yen"
db.TableDefs("seisann").Fields("_2000yen").Name = "currency2000yen"
db.TableDefs("seisann").Fields("_5000yen").Name = "currency5000yen"
db.TableDefs("seisann").Fields("_10000yen").Name = "currency10000yen"
db.TableDefs("seisann").Fields.Refresh

strSql = "ALTER TABLE kokyaku ADD COLUMN nebiki INTEGER;"

db.Execute strSql

db.Close

End If


'14.0x

If iVersion <= 14 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "CREATE TABLE sethannbai (sethannbaiid AUTOINCREMENT,shouhinnid INTEGER,groupid INTEGER,groupmei TEXT(50),nebikigaku DOUBLE,priority INTEGER);"

db.Execute strSql

db.Close

End If

'15.0x

If iVersion <= 15 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "ALTER TABLE seisann ADD COLUMN tempmemo TEXT(255);"

db.Execute strSql

strSql = "ALTER TABLE shouhinn ADD COLUMN pointtaishou SHORT;"

db.Execute strSql

db.Close

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

db.TableDefs("seisann").Fields("tempmemo").Name = "memo"
db.TableDefs("seisann").Fields.Refresh

db.Close

End If

'16.0x から

If iVersion <= 16 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

db.TableDefs("nyushukkamain").Fields("gennkinnazukariid").Name = "subcategoryid"
db.TableDefs("nyushukkamain").Fields.Refresh

db.Close

End If

'17.0x

If iVersion <= 17 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "ALTER TABLE kokyaku ADD COLUMN pointtaishou SHORT;"

db.Execute strSql

db.Close

End If

'18.0x

If iVersion <= 18 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "ALTER TABLE nyushukkamain ADD COLUMN ichibunyuukinn SHORT;"

db.Execute strSql

strSql = "ALTER TABLE nyushukkamain ADD COLUMN ichijihojigyoumuhannbai SHORT;"

db.Execute strSql

db.TableDefs("nyushukkamain").Fields("yoyakuuketoridate").Name = "ichijihojigyoumuuketoridate"
db.TableDefs("nyushukkamain").Fields.Refresh

strSql = "ALTER TABLE shouhinn ADD COLUMN macrofilepath TEXT(50);"

db.Execute strSql

db.Close

End If

'19.0x

'strSql = "ALTER TABLE seisann ADD COLUMN extracategoryuriagekennsuu DOUBLE;"

'db.Execute strSql

'strSql = "ALTER TABLE seisann ADD COLUMN extracategoryuriagekinngaku DOUBLE;"

'db.Execute strSql

'20.0x

If iVersion <= 20 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "ALTER TABLE sethannbai ADD COLUMN barcodeno TEXT(50);"

db.Execute strSql

strSql = "ALTER TABLE nyushukkamain ADD COLUMN kyakusuu INTEGER;"

db.Execute strSql

strSql = "ALTER TABLE shiiresaki ALTER COLUMN shiiresakimei TEXT(100);"

db.Execute strSql

strSql = "ALTER TABLE shiiresaki ALTER COLUMN shiiresakimeikana TEXT(100);"

db.Execute strSql

db.Close

End If

'21.0x

If iVersion <= 21 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "ALTER TABLE nyushukkamain ADD COLUMN olddennpyouno INTEGER;"

db.Execute strSql

db.TableDefs("shouhinn").Fields("waribikitaishou").Name = "nebikiwaribikitaishou"
db.TableDefs("shouhinn").Fields.Refresh

db.TableDefs("seisann").Fields("kakeuriagakinngaku").Name = "kakeuriagekinngaku"
db.TableDefs("seisann").Fields.Refresh

db.Close

End If

'22.0x

If iVersion <= 22 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "CREATE TABLE sethannbaisub (nyushukkaid INTEGER,groupid INTEGER,nyuukasuu DOUBLE,shukkasuu DOUBLE,shoukei DOUBLE,nebikigaku DOUBLE);"

db.Execute strSql

db.Close

End If

'23.0x

If iVersion <= 23 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "ALTER TABLE shouhinn ADD COLUMN picture LONGBINARY;"

db.Execute strSql

strSql = "ALTER TABLE shouhinn ADD COLUMN picturename TEXT(50);"

db.Execute strSql

db.Close

End If

'24.0x

If iVersion <= 24 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "ALTER TABLE nyushukkamain ADD COLUMN seisannno INTEGER;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN seisannno INTEGER;"

db.Execute strSql

db.Close

End If

'25.0x

If iVersion <= 25 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "ALTER TABLE nyushukkamain ADD COLUMN koumoku TEXT(50);"

db.Execute strSql

strSql = "ALTER TABLE nyushukkamain ADD COLUMN tempmemo TEXT(50);"

db.Execute strSql


strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu3 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu4 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu5 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu6 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu7 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu8 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu9 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu10 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu11 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu12 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu13 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu14 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu15 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu16 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu17 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu18 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu19 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekennsuu20 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku3 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku4 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku5 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku6 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku7 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku8 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku9 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku10 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku11 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku12 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku13 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku14 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku15 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku16 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku17 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku18 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku19 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN carduriagekinngaku20 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu3 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu4 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu5 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu6 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu7 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu8 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu9 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu10 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu11 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu12 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu13 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu14 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu15 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu16 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu17 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu18 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu19 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekennsuu20 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku3 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku4 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku5 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku6 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku7 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku8 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku9 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku10 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku11 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku12 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku13 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku14 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku15 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku16 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku17 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku18 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku19 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN shouhinnkennuriagekinngaku20 DOUBLE;"

db.Execute strSql



db.Close


End If

'26.0x

If iVersion <= 26 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

strSql = "ALTER TABLE shouhinn ADD COLUMN taxrate INTEGER;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN zeikinn1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN zeikinn2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN uchizei1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN uchizei2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN uchizeitaishou1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN uchizeitaishou2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN sotozeitaishou1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN sotozeitaishou2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN uchizeitaishouwaribiki1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN uchizeitaishouwaribiki2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN sotozeitaishouwaribiki1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE goukei ADD COLUMN sotozeitaishouwaribiki2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE nyushukkasub ADD COLUMN tax TEXT(50);"

db.Execute strSql

strSql = "ALTER TABLE nyushukkasub ADD COLUMN taxrate INTEGER;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN uchizeikinngaku1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN uchizeikinngaku2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN uchizeitaishou1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN uchizeitaishou2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN sotozeikinngaku1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN sotozeikinngaku2 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN sotozeitaishou1 DOUBLE;"

db.Execute strSql

strSql = "ALTER TABLE seisann ADD COLUMN sotozeitaishou2 DOUBLE;"

db.Execute strSql

db.Close

End If




'16.0x から

'17.0x
If iVersion <= 17 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

db.TableDefs("kokyaku").Fields("pointtaishou").DefaultValue = 0
db.TableDefs("kokyaku").Fields.Refresh

strSql = "UPDATE kokyaku SET pointtaishou = 1 WHERE (pointtaishou IS NULL);"

db.Execute strSql

db.Close

End If

'18.0x
If iVersion <= 18 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

db.TableDefs("nyushukkamain").Fields("ichibunyuukinn").DefaultValue = 0
db.TableDefs("nyushukkamain").Fields("ichijihojigyoumuhannbai").DefaultValue = 0
db.TableDefs("nyushukkamain").Fields.Refresh

strSql = "UPDATE nyushukkamain SET ichibunyuukinn = 0 WHERE (ichibunyuukinn IS NULL);"

db.Execute strSql

strSql = "UPDATE nyushukkamain SET ichijihojigyoumuhannbai = 0 WHERE (ichijihojigyoumuhannbai IS NULL);"

db.Execute strSql

db.Close

End If

'19.0x
If iVersion <= 19 Then

'db.TableDefs("seisann").Fields("extracategoryuriagekennsuu").DefaultValue = 0
'db.TableDefs("seisann").Fields("extracategoryuriagekinngaku").DefaultValue = 0
'db.TableDefs("seisann").Fields.Refresh

End If



'20.0x

If iVersion <= 20 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

db.TableDefs("nyushukkamain").Fields("kyakusuu").DefaultValue = 0
db.TableDefs("nyushukkamain").Fields.Refresh

strSql = "UPDATE nyushukkamain SET kyakusuu = 0 WHERE (kyakusuu IS NULL);"

db.Execute strSql

db.Close

End If

'21.0x
If iVersion <= 21 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

db.TableDefs("nyushukkamain").Fields("olddennpyouno").DefaultValue = 0
db.TableDefs("nyushukkamain").Fields.Refresh

strSql = "UPDATE nyushukkamain SET olddennpyouno = 0 WHERE (olddennpyouno IS NULL);"

db.Execute strSql

db.Close

End If

'22.0x
If iVersion <= 22 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

db.TableDefs("sethannbaisub").Fields("nyushukkaid").DefaultValue = 0
db.TableDefs("sethannbaisub").Fields("groupid").DefaultValue = 0
db.TableDefs("sethannbaisub").Fields("nyuukasuu").DefaultValue = 0
db.TableDefs("sethannbaisub").Fields("shukkasuu").DefaultValue = 0
db.TableDefs("sethannbaisub").Fields("shoukei").DefaultValue = 0
db.TableDefs("sethannbaisub").Fields("nebikigaku").DefaultValue = 0
db.TableDefs("sethannbaisub").Fields.Refresh

strSql = "UPDATE sethannbaisub SET nyushukkaid = 0 WHERE (nyushukkaid IS NULL);"

db.Execute strSql

strSql = "UPDATE sethannbaisub SET groupid = 0 WHERE (groupid IS NULL);"

db.Execute strSql

strSql = "UPDATE sethannbaisub SET nyuukasuu = 0 WHERE (nyuukasuu IS NULL);"

db.Execute strSql

strSql = "UPDATE sethannbaisub SET shukkasuu = 0 WHERE (shukkasuu IS NULL);"

db.Execute strSql

strSql = "UPDATE sethannbaisub SET shoukei = 0 WHERE (shoukei IS NULL);"

db.Execute strSql

strSql = "UPDATE sethannbaisub SET nebikigaku = 0 WHERE (nebikigaku IS NULL);"

db.Execute strSql

db.Close

End If

'23.0x


'24.0x
If iVersion <= 24 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

db.TableDefs("nyushukkamain").Fields("seisannno").DefaultValue = 0
db.TableDefs("nyushukkamain").Fields.Refresh

strSql = "UPDATE nyushukkamain SET seisannno = 0 WHERE (seisannno IS NULL);"

db.Execute strSql

db.TableDefs("seisann").Fields("seisannno").DefaultValue = 0
db.TableDefs("seisann").Fields.Refresh

strSql = "UPDATE seisann SET seisannno = 0 WHERE (seisannno IS NULL);"

db.Execute strSql

db.Close

End If

'25.0x
If iVersion <= 25 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

db.TableDefs("nyushukkamain").Fields("tempmemo").Name = "memo"
db.TableDefs("nyushukkamain").Fields.Refresh

db.TableDefs("seisann").Fields("carduriagekennsuu1").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu2").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu3").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu4").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu5").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu6").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu7").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu8").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu9").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu10").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu11").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu12").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu13").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu14").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu15").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu16").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu17").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu18").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu19").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekennsuu20").DefaultValue = 0

db.TableDefs("seisann").Fields("carduriagekinngaku1").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku2").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku3").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku4").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku5").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku6").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku7").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku8").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku9").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku10").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku11").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku12").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku13").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku14").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku15").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku16").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku17").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku18").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku19").DefaultValue = 0
db.TableDefs("seisann").Fields("carduriagekinngaku20").DefaultValue = 0

db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu1").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu2").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu3").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu4").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu5").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu6").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu7").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu8").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu9").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu10").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu11").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu12").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu13").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu14").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu15").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu16").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu17").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu18").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu19").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekennsuu20").DefaultValue = 0

db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku1").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku2").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku3").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku4").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku5").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku6").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku7").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku8").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku9").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku10").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku11").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku12").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku13").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku14").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku15").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku16").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku17").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku18").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku19").DefaultValue = 0
db.TableDefs("seisann").Fields("shouhinnkennuriagekinngaku20").DefaultValue = 0

db.TableDefs("seisann").Fields.Refresh


strSql = "UPDATE seisann SET carduriagekennsuu1 = 0 WHERE (carduriagekennsuu1 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu2 = 0 WHERE (carduriagekennsuu2 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu3 = 0 WHERE (carduriagekennsuu3 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu4 = 0 WHERE (carduriagekennsuu4 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu5 = 0 WHERE (carduriagekennsuu5 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu6 = 0 WHERE (carduriagekennsuu6 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu7 = 0 WHERE (carduriagekennsuu7 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu8 = 0 WHERE (carduriagekennsuu8 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu9 = 0 WHERE (carduriagekennsuu9 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu10 = 0 WHERE (carduriagekennsuu10 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu11 = 0 WHERE (carduriagekennsuu11 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu12 = 0 WHERE (carduriagekennsuu12 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu13 = 0 WHERE (carduriagekennsuu13 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu14 = 0 WHERE (carduriagekennsuu14 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu15 = 0 WHERE (carduriagekennsuu15 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu16 = 0 WHERE (carduriagekennsuu16 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu17 = 0 WHERE (carduriagekennsuu17 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu18 = 0 WHERE (carduriagekennsuu18 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu19 = 0 WHERE (carduriagekennsuu19 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekennsuu20 = 0 WHERE (carduriagekennsuu20 IS NULL);"

db.Execute strSql




strSql = "UPDATE seisann SET carduriagekinngaku1 = 0 WHERE (carduriagekinngaku1 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku2 = 0 WHERE (carduriagekinngaku2 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku3 = 0 WHERE (carduriagekinngaku3 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku4 = 0 WHERE (carduriagekinngaku4 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku5 = 0 WHERE (carduriagekinngaku5 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku6 = 0 WHERE (carduriagekinngaku6 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku7 = 0 WHERE (carduriagekinngaku7 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku8 = 0 WHERE (carduriagekinngaku8 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku9 = 0 WHERE (carduriagekinngaku9 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku10 = 0 WHERE (carduriagekinngaku10 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku11 = 0 WHERE (carduriagekinngaku11 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku12 = 0 WHERE (carduriagekinngaku12 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku13 = 0 WHERE (carduriagekinngaku13 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku14 = 0 WHERE (carduriagekinngaku14 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku15 = 0 WHERE (carduriagekinngaku15 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku16 = 0 WHERE (carduriagekinngaku16 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku17 = 0 WHERE (carduriagekinngaku17 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku18 = 0 WHERE (carduriagekinngaku18 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku19 = 0 WHERE (carduriagekinngaku19 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET carduriagekinngaku20 = 0 WHERE (carduriagekinngaku20 IS NULL);"

db.Execute strSql



strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu1 = 0 WHERE (shouhinnkennuriagekennsuu1 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu2 = 0 WHERE (shouhinnkennuriagekennsuu2 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu3 = 0 WHERE (shouhinnkennuriagekennsuu3 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu4 = 0 WHERE (shouhinnkennuriagekennsuu4 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu5 = 0 WHERE (shouhinnkennuriagekennsuu5 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu6 = 0 WHERE (shouhinnkennuriagekennsuu6 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu7 = 0 WHERE (shouhinnkennuriagekennsuu7 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu8 = 0 WHERE (shouhinnkennuriagekennsuu8 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu9 = 0 WHERE (shouhinnkennuriagekennsuu9 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu10 = 0 WHERE (shouhinnkennuriagekennsuu10 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu11 = 0 WHERE (shouhinnkennuriagekennsuu11 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu12 = 0 WHERE (shouhinnkennuriagekennsuu12 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu13 = 0 WHERE (shouhinnkennuriagekennsuu13 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu14 = 0 WHERE (shouhinnkennuriagekennsuu14 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu15 = 0 WHERE (shouhinnkennuriagekennsuu15 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu16 = 0 WHERE (shouhinnkennuriagekennsuu16 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu17 = 0 WHERE (shouhinnkennuriagekennsuu17 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu18 = 0 WHERE (shouhinnkennuriagekennsuu18 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu19 = 0 WHERE (shouhinnkennuriagekennsuu19 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekennsuu20 = 0 WHERE (shouhinnkennuriagekennsuu20 IS NULL);"

db.Execute strSql



strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku1 = 0 WHERE (shouhinnkennuriagekinngaku1 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku2 = 0 WHERE (shouhinnkennuriagekinngaku2 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku3 = 0 WHERE (shouhinnkennuriagekinngaku3 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku4 = 0 WHERE (shouhinnkennuriagekinngaku4 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku5 = 0 WHERE (shouhinnkennuriagekinngaku5 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku6 = 0 WHERE (shouhinnkennuriagekinngaku6 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku7 = 0 WHERE (shouhinnkennuriagekinngaku7 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku8 = 0 WHERE (shouhinnkennuriagekinngaku8 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku9 = 0 WHERE (shouhinnkennuriagekinngaku9 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku10 = 0 WHERE (shouhinnkennuriagekinngaku10 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku11 = 0 WHERE (shouhinnkennuriagekinngaku11 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku12 = 0 WHERE (shouhinnkennuriagekinngaku12 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku13 = 0 WHERE (shouhinnkennuriagekinngaku13 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku14 = 0 WHERE (shouhinnkennuriagekinngaku14 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku15 = 0 WHERE (shouhinnkennuriagekinngaku15 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku16 = 0 WHERE (shouhinnkennuriagekinngaku16 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku17 = 0 WHERE (shouhinnkennuriagekinngaku17 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku18 = 0 WHERE (shouhinnkennuriagekinngaku18 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku19 = 0 WHERE (shouhinnkennuriagekinngaku19 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET shouhinnkennuriagekinngaku20 = 0 WHERE (shouhinnkennuriagekinngaku20 IS NULL);"

db.Execute strSql


db.Close

Dim dbResSub As DAO.Recordset
Dim dbResMain As DAO.Recordset

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

Set dbResSub = db.OpenRecordset("nyushukkasub", dbOpenSnapshot)

dbResSub.Filter = ""
dbResSub.Sort = "nyushukkaid"

Set dbResSub = dbResSub.OpenRecordset()

If Not dbResSub.EOF Then
dbResSub.MoveFirst
End If

Do Until dbResSub.EOF

Set dbResMain = db.OpenRecordset("nyushukkamain", dbOpenDynaset)

dbResMain.Filter = "nyushukkaid = " + CStr(dbResSub("nyushukkaid").Value)

Set dbResMain = dbResMain.OpenRecordset()

If Not dbResMain.EOF Then
dbResMain.MoveFirst
End If

Do Until dbResMain.EOF

If dbResSub("memo").Value <> "" Or dbResSub("koumoku").Value <> "" Then

dbResMain.Edit

dbResMain("memo").Value = dbResSub("memo").Value
dbResMain("koumoku").Value = dbResSub("koumoku").Value

dbResMain.Update

End If

dbResMain.MoveNext

Loop

dbResSub.MoveNext
Loop

db.Close

Set dbResSub = Nothing
Set dbResMain = Nothing

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")

Set dbResMain = db.OpenRecordset("nyushukkamain", dbOpenDynaset)

dbResMain.Filter = "category LIKE '*カード*'"

Set dbResMain = dbResMain.OpenRecordset()

If Not dbResMain.EOF Then
dbResMain.MoveFirst
End If

Dim strCategory As String

Do Until dbResMain.EOF

If dbResMain("category").Value <> "" And dbResMain("category").Value <> "クレジットカード" And dbResMain("category").Value <> "クレジットカード返品" Then

dbResMain.Edit

strCategory = dbResMain("category").Value

If InStr(strCategory, "返品") <= 0 Then

dbResMain("koumoku").Value = strCategory
dbResMain("category").Value = "カード"
Else

strCategory = Replace(strCategory, "返品", "")
dbResMain("koumoku").Value = strCategory
dbResMain("category").Value = "カード返品"

End If


dbResMain.Update

End If

dbResMain.MoveNext

Loop

If strCategory <> "" Then

strSql = "UPDATE nyushukkamain SET category = 'カード',koumoku = 'クレジットカード' WHERE (category = 'クレジットカード');"

db.Execute strSql

strSql = "UPDATE nyushukkamain SET category = 'カード返品' ,koumoku = 'クレジットカード' WHERE (category = 'クレジットカード返品');"

db.Execute strSql
Else

strSql = "UPDATE nyushukkamain SET category = 'カード' WHERE (category = 'クレジットカード');"

db.Execute strSql

strSql = "UPDATE nyushukkamain SET category = 'カード返品' WHERE (category = 'クレジットカード返品');"

db.Execute strSql

End If

strSql = "UPDATE nyushukkamain SET category = '入金[精算対象外]' WHERE (category = '入金【精算対象外】');"

db.Execute strSql

db.Close

Set dbResSub = Nothing
Set dbResMain = Nothing

If strCategory <> "" Then

MsgBox "※重要 Nyushukkaメニュー「ファイル」「各種設定」「メイン画面」のカード設定で、番号1に「クレジットカード」、番号2に「" & strCategory & "」を設定して下さい"

End If


End If

'26.0x

Dim strNyushukkaTaxRate As String


If iVersion <= 26 Then

Set db = DBEngine.OpenDatabase(strFilePath, _
False, False, "")


strNyushukkaTaxRate = Module1.RegGetValue(HKEY_CURRENT_USER, _
"Software\Nyushukka\Nyushukka\PropertyKeisann", _
"m_csZeiritsu", _
REG_SZ, _
"")


db.TableDefs("shouhinn").Fields("taxrate").DefaultValue = -1
db.TableDefs("shouhinn").Fields.Refresh

strSql = "UPDATE shouhinn SET taxrate = -1;"
db.Execute strSql


If IsEmpty(strNyushukkaTaxRate) = False Then

strSql = "UPDATE shouhinn SET taxrate = " & strNyushukkaTaxRate & " WHERE (tax <> '非');"
db.Execute strSql

End If



db.TableDefs("goukei").Fields("zeikinn1").DefaultValue = 0
db.TableDefs("goukei").Fields("zeikinn2").DefaultValue = 0
db.TableDefs("goukei").Fields("uchizei1").DefaultValue = 0
db.TableDefs("goukei").Fields("uchizei2").DefaultValue = 0
db.TableDefs("goukei").Fields("uchizeitaishou1").DefaultValue = 0
db.TableDefs("goukei").Fields("uchizeitaishou2").DefaultValue = 0
db.TableDefs("goukei").Fields("sotozeitaishou1").DefaultValue = 0
db.TableDefs("goukei").Fields("sotozeitaishou2").DefaultValue = 0
db.TableDefs("goukei").Fields("uchizeitaishouwaribiki1").DefaultValue = 0
db.TableDefs("goukei").Fields("uchizeitaishouwaribiki2").DefaultValue = 0
db.TableDefs("goukei").Fields("sotozeitaishouwaribiki1").DefaultValue = 0
db.TableDefs("goukei").Fields("sotozeitaishouwaribiki2").DefaultValue = 0
db.TableDefs("goukei").Fields.Refresh

strSql = "UPDATE goukei SET zeikinn1 = 0 WHERE (zeikinn1 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET zeikinn2 = 0 WHERE (zeikinn2 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET uchizei1 = 0 WHERE (uchizei1 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET uchizei2 = 0 WHERE (uchizei2 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET uchizeitaishou1 = 0 WHERE (uchizeitaishou1 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET uchizeitaishou2 = 0 WHERE (uchizeitaishou2 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET sotozeitaishou1 = 0 WHERE (sotozeitaishou1 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET sotozeitaishou2 = 0 WHERE (sotozeitaishou2 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET uchizeitaishouwaribiki1 = 0 WHERE (uchizeitaishouwaribiki1 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET uchizeitaishouwaribiki2 = 0 WHERE (uchizeitaishouwaribiki2 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET sotozeitaishouwaribiki1 = 0 WHERE (sotozeitaishouwaribiki1 IS NULL);"

db.Execute strSql

strSql = "UPDATE goukei SET sotozeitaishouwaribiki2 = 0 WHERE (sotozeitaishouwaribiki2 IS NULL);"

db.Execute strSql


db.TableDefs("nyushukkasub").Fields("taxrate").DefaultValue = -1
db.TableDefs("nyushukkasub").Fields.Refresh

strSql = "UPDATE nyushukkasub SET taxrate = -1;"

db.Execute strSql

db.TableDefs("seisann").Fields("uchizeikinngaku1").DefaultValue = 0
db.TableDefs("seisann").Fields("uchizeikinngaku2").DefaultValue = 0
db.TableDefs("seisann").Fields("uchizeitaishou1").DefaultValue = 0
db.TableDefs("seisann").Fields("uchizeitaishou2").DefaultValue = 0
db.TableDefs("seisann").Fields("sotozeikinngaku1").DefaultValue = 0
db.TableDefs("seisann").Fields("sotozeikinngaku2").DefaultValue = 0
db.TableDefs("seisann").Fields("sotozeitaishou1").DefaultValue = 0
db.TableDefs("seisann").Fields("sotozeitaishou2").DefaultValue = 0
db.TableDefs("seisann").Fields.Refresh

strSql = "UPDATE seisann SET uchizeikinngaku1 = 0 WHERE (uchizeikinngaku1 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET uchizeikinngaku2 = 0 WHERE (uchizeikinngaku2 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET uchizeitaishou1 = 0 WHERE (uchizeitaishou1 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET uchizeitaishou2 = 0 WHERE (uchizeitaishou2 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET sotozeikinngaku1 = 0 WHERE (sotozeikinngaku1 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET sotozeikinngaku2 = 0 WHERE (sotozeikinngaku2 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET sotozeitaishou1 = 0 WHERE (sotozeitaishou1 IS NULL);"

db.Execute strSql

strSql = "UPDATE seisann SET sotozeitaishou2 = 0 WHERE (sotozeitaishou2 IS NULL);"

db.Execute strSql

db.Close

End If


Me.MousePointer = 0

If iVersion < 26 Then

If IsEmpty(strNyushukkaTaxRate) = True Then

MsgBox "各商品の税率は未設定です"
End If

MsgBox "完了しました。Nyushukkaを起動して「精算」画面の「精算確定」ボタンを押して下さい"

Else

If IsEmpty(strNyushukkaTaxRate) = True Then

MsgBox "各商品の税率は未設定です"
End If

MsgBox "完了しました。"

End If


End Sub

Private Sub Form_Load()

Combo1.AddItem ("12")
Combo1.AddItem ("13")
Combo1.AddItem ("14")
Combo1.AddItem ("15")
Combo1.AddItem ("16")
Combo1.AddItem ("17")
Combo1.AddItem ("18")
Combo1.AddItem ("19")
Combo1.AddItem ("20")
Combo1.AddItem ("21")
Combo1.AddItem ("22")
Combo1.AddItem ("23")
Combo1.AddItem ("24")
Combo1.AddItem ("25")
Combo1.AddItem ("26")

End Sub

 

ホーム

|

ソフトウェア

|

ダウンロード

|  

FAQ

|  

ご購入

|  

お問い合わせ

このサイトに含まれる社名、製品名は、その版権所有者の商標または登録商標です。

本サイトの著作権は、川崎政則(以後、著作権者)に帰属します。本サイトのデータを、いかなる形でもコピー、複製、再出版、掲示、配布することはできません。