lucdrb Active Member Licensed User Longtime User Aug 9, 2016 #1 Hi I want to verify if my db file exist in the DirData directory and if not copy it from the DirApp my code: If Not File.Exists(File.DirData,"qizine.rsd") Then File.Copy(File.DirApp,"qizine.rsd", File.DirData,"qizine.rsd") End If on the 2 lines the compiler said: missing parameters The #AdditionalJar: sqlite-jdbc-3.7.2 is in projects attribute This code works well in B4A. Any Help would be welcome Thanks Luc
Hi I want to verify if my db file exist in the DirData directory and if not copy it from the DirApp my code: If Not File.Exists(File.DirData,"qizine.rsd") Then File.Copy(File.DirApp,"qizine.rsd", File.DirData,"qizine.rsd") End If on the 2 lines the compiler said: missing parameters The #AdditionalJar: sqlite-jdbc-3.7.2 is in projects attribute This code works well in B4A. Any Help would be welcome Thanks Luc
LucaMs Expert Licensed User Longtime User Aug 9, 2016 #2 Please, post the error msg, since there are no missing parameters in your File.Copy. (I suppose that the AdditionalJar in your project is correct, with the right path and file name. The sqlite... jar must be in the additional libraries path) Last edited: Aug 9, 2016 Upvote 0
Please, post the error msg, since there are no missing parameters in your File.Copy. (I suppose that the AdditionalJar in your project is correct, with the right path and file name. The sqlite... jar must be in the additional libraries path)
lucdrb Active Member Licensed User Longtime User Aug 9, 2016 #3 You'll find hereafter the all text of the Main #Region Project Attributes #MainFormWidth: 600 #MainFormHeight: 400 #AdditionalJar: sqlite-jdbc-3.7.2 #End Region Sub Process_Globals Public db As SQL Private fx As JFX Private MainForm As Form End Sub Sub AppStart (Form1 As Form, Args() As String) LoadDatabase End Sub Sub LoadDatabase If Not (File.Exists(File.DirData,"qizine.rsd")) Then File.Copy(File.DirApp,"qizine.rsd", File.DirData,"qizine.rsd") End If db.InitializeSQLite(File.DirData,"qizine.rsd") End Sub and a screen copy of the error msg When I make a new B4J, It work until I saved it. Thanks in advance Luc Upvote 0
You'll find hereafter the all text of the Main #Region Project Attributes #MainFormWidth: 600 #MainFormHeight: 400 #AdditionalJar: sqlite-jdbc-3.7.2 #End Region Sub Process_Globals Public db As SQL Private fx As JFX Private MainForm As Form End Sub Sub AppStart (Form1 As Form, Args() As String) LoadDatabase End Sub Sub LoadDatabase If Not (File.Exists(File.DirData,"qizine.rsd")) Then File.Copy(File.DirApp,"qizine.rsd", File.DirData,"qizine.rsd") End If db.InitializeSQLite(File.DirData,"qizine.rsd") End Sub and a screen copy of the error msg When I make a new B4J, It work until I saved it. Thanks in advance Luc
LucaMs Expert Licensed User Longtime User Aug 9, 2016 #4 The missing parameter is in File.DirData (see the tip of the command). Probably you want to do as in B4A, copy from assets to application directory; then you should use: Code: Copy If Not(File.Exists(File.DirApp,"qizine.rsd")) Then File.Copy(File.DirAssets, "qizine.rsd", File.DirApp, "qizine.rsd") "qizine.rsd" must be added by Files Manager - Add Files, of course Last edited: Aug 9, 2016 Upvote 0
The missing parameter is in File.DirData (see the tip of the command). Probably you want to do as in B4A, copy from assets to application directory; then you should use: Code: Copy If Not(File.Exists(File.DirApp,"qizine.rsd")) Then File.Copy(File.DirAssets, "qizine.rsd", File.DirApp, "qizine.rsd") "qizine.rsd" must be added by Files Manager - Add Files, of course
Gianni M Well-Known Member Licensed User Longtime User Aug 9, 2016 #5 Code: Copy If File.Exists(File.DirApp,"qizine.rsd")=False Then 'make copy End If Upvote 0
lucdrb Active Member Licensed User Longtime User Aug 9, 2016 #6 Ok Thanks but: The file.DirApp is read only, how should I use it to write into de DB (it's why I used the file.dirData directory)? -To Giannimimaione thanks but I've already try it and the result is the same "missing parameter Luc Upvote 0
Ok Thanks but: The file.DirApp is read only, how should I use it to write into de DB (it's why I used the file.dirData directory)? -To Giannimimaione thanks but I've already try it and the result is the same "missing parameter Luc
LucaMs Expert Licensed User Longtime User Aug 9, 2016 #7 lucdrb said: The file.DirApp is read only Click to expand... You're right but you can create a sub dir in DirApp and write there: Code: Copy Dim MySubDir As String = File.Combine(File.DirApp, "SubDir") If Not(File.Exists(MySubDir, "")) Then File.MakeDir(MySubDir, "") End If Last edited: Aug 9, 2016 Upvote 0
lucdrb said: The file.DirApp is read only Click to expand... You're right but you can create a sub dir in DirApp and write there: Code: Copy Dim MySubDir As String = File.Combine(File.DirApp, "SubDir") If Not(File.Exists(MySubDir, "")) Then File.MakeDir(MySubDir, "") End If
lucdrb Active Member Licensed User Longtime User Aug 9, 2016 #8 Ok Many thanks for your help I'll can go further. Luc Upvote 0
lucdrb Active Member Licensed User Longtime User Aug 10, 2016 #9 I've found the missing parameter. It's the (AppNameAsString) who as to be after the dirdata. Now with it everything is Ok Luc Upvote 0
I've found the missing parameter. It's the (AppNameAsString) who as to be after the dirdata. Now with it everything is Ok Luc