PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
Sqlite version control - Controle Versao Sqlite
Sqlite version control - Controle Versao Sqlite
Started by adrianoboller, Nov., 18 2014 1:50 PM - No answer
Connect yourself…
adrianoboller
#1
Registered member
3,662 messages
Popularité : +175 (223 votes)
Posted on November, 18 2014 - 1:50 PM
Procedure
DB_ControleVersaoSql
(
)
//VERSAO ATUAL A VERIFICAR
VersaoNova is
string
=
"3.0"
// <---- aumente a versao para excluir a base antiga antes de publicar no google play
//Path
//sBasePath is string = ""
s
PathArquivoIni is
string
=
""
//Connect
s
DatabaseName is
string
=
"FaixaVermelha.db"
s
NomeArquivoIni is
string
=
"DB.ini"
IF
InSimulatorMode
(
) =
False
gs
BasePath
=
gs
AppDir
+ [
"/DB/"
] +
s
DatabaseName
s
PathArquivoIni
=
gs
AppDir
+ [
"/DB/"
] +
s
NomeArquivoIni
ELSE
gs
BasePath
=
gs
AppDir
+ [
"\DB\"
] +
s
DatabaseName
s
PathArquivoIni
=
gs
AppDir
+ [
"\DB\"
] +
s
NomeArquivoIni
END
//Se nao tem o arquivo ini
IF
fFileExist
(
s
PathArquivoIni
) =
False
AND
fFileExist
(
gs
BasePath
) =
True
THEN
fDelete
(
gs
BasePath
)
INIWrite
(
"BaseDados"
,
"Versao"
,
VersaoNova
,
s
PathArquivoIni
)
//Se existe o ini e o banco verifique a versao
ELSE IF
fFileExist
(
s
PathArquivoIni
) =
True
AND
fFileExist
(
gs
BasePath
) =
True
THEN
//Se versao diferente exclua
VersaoExistente is
string
=
INIRead
(
"BaseDados"
,
"Versao"
,
""
,
s
PathArquivoIni
)
IF
VersaoExistente
<
>
VersaoNova
THEN
fDelete
(
gs
BasePath
)
END
//Atualiza Arquivo ini
INIWrite
(
"BaseDados"
,
"Versao"
,
VersaoNova
,
s
PathArquivoIni
)
//Nao existe nada
ELSE IF
fFileExist
(
s
PathArquivoIni
) =
False
AND
fFileExist
(
gs
BasePath
) =
False
THEN
INIWrite
(
"BaseDados"
,
"Versao"
,
VersaoNova
,
s
PathArquivoIni
)
END
//Se Tiver ExcluirTudo = SIM
IF
INIRead
(
"BaseDados"
,
"ExcluirTudo"
,
""
,
s
PathArquivoIni
) =
"SIM"
THEN
fDelete
(
gs
BasePath
)
fDelete
(
s
PathArquivoIni
)
fRemoveDir
(
gs
AppDir
)
NextTitle
(
"Atenção"
)
Info
(
"Inicialize novamente o aplicativo."
)
Close
(
)
END
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text