PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 24 → WX INFORMATICA - NOVO METODO CREATE DATABASE HFSQL CLIENT/SERVER VIA WEBSERVICE COM DIRETIVAS OK
WX INFORMATICA - NOVO METODO CREATE DATABASE HFSQL CLIENT/SERVER VIA WEBSERVICE COM DIRETIVAS OK
Iniciado por BOLLER, jul., 13 2019 6:11 AM - 5 respostas
Membro registado
2.962 mensagems
Popularité : +89 (91 votes)
Publicado em julho, 13 2019 - 6:11 AM
METODO CREATE DATABASE HFSQL CLIENT/SERVER VIA WEBSERVICE COM DIRETIVAS OK

Procedure ws_create_database(Token,Nome,Email,Telefone,Database,Usermaster,PasswordMaster)

ok is string

IF Token <> "" AND Token = "abre-ti-cesamo" AND Database <> "" AND Nome <> "" AND Telefone <> ""

HOpenConnection(MyConnection)
HChangeConnection("*",MyConnection)

Database.Nome = Nome
Database.Telefone = Telefone
Database.Database = Database
HAdd(Database)

HCloseConnection(MyConnection)

Myconn is Connection
Myconn..Server = "localhost"
Myconn..User = "admin"
Myconn..Password = "202020"
Myconn..Database = Database
Myconn..Provider = hAccessHFClientServer
IF HOpenConnection(Myconn) = True THEN
IF HChangeConnection("*",Myconn) = True THEN
HModifyStructure("*")
HCreationIfNotFound("*")
ok = "Database criada com Sucesso!"

HUser.Login = Usermaster
HUser.Password = PasswordMaster
HUser.FullName = Nome +" / "+ Usermaster
HUser.Email = Email
HUser.Phone = Telefone
HUser.Groups = "ClientWebDev"
HUser.EnabledAccount = True

IF HModifyUser(Myconn,Usermaster) = True THEN
ok += " = Usuario: "+Usermaster+" foi atribuido ao Banco de dados"
END

HModifyServerRights(Myconn,Usermaster,hRightsChangePassword,hAllowed)
HModifyServerRights(Myconn,Usermaster,hRightsChangeRights,hAllowed)
HModifyServerRights(Myconn,Usermaster,hRightsCreateDB,hAllowed)
HModifyServerRights(Myconn,Usermaster,hRightsManageUser,hAllowed)
HModifyServerRights(Myconn,Usermaster,hRightsSeeUser,hAllowed)
HModifyServerRights(Myconn,Usermaster,hRightsManageServer,hAllowed)

HModifyDatabaseRights(Myconn,Usermaster,hRightsAutoModif,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsChangeLink,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsChangeOwner,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsChangeRights,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsConnection,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsCreateFile,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsCreateView,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsDebug,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsDelete,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsDeleteDB,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsDeleteFile,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsEncryptedConnection,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsInsert,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsLock,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsMaintenance,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsManageDuplicate,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsManageIntegrity,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsManageProcedure,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsManageTask,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsNoDatabaseAccess,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsRead,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsRunProcedure,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsUpdate,hAllowed,Database)

ok += ", Diretivas adicionadas com Sucesso!"

HCloseConnection(Myconn)
END
END

END

arrResultado is array of string

Add(arrResultado,ok)

RESULT ok


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Mensagem modificada, julho, 13 2019 - 6:12 AM
Membro registado
2.962 mensagems
Popularité : +89 (91 votes)
Publicado em julho, 13 2019 - 6:16 AM
LINKS COMPLEMENTARES

https://doc.windev.com/?3044281&lang=en-US&productversion=xxA240075m

https://doc.windev.com/?3044322&name=hinfoserverrights_function

https://doc.windev.com/?3044328&name=hmodifyserverrights_function

https://doc.windev.com/?3044326&name=hmodifydatabaserights_function


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Mensagem modificada, julho, 13 2019 - 6:16 AM
Membro registado
2.962 mensagems
Popularité : +89 (91 votes)
Publicado em julho, 13 2019 - 6:43 AM
Exemplos

https://repository.windev.com/publish.awp?file_id=281474976710830;mini-saas-example

https://repository.windev.com/publish.awp?file_id=281474976710832;complemento-mini-saas-example-webservice-create-database-with-rights-server-database


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Membro registado
2.962 mensagems
Popularité : +89 (91 votes)
Publicado em julho, 13 2019 - 6:45 AM
CRIANDO BANCO DE DADOS HFSQL VIA WEBSERVICE

EXEMPLO DO PROCESSO DE CRIACAO E DEFINICAO DE ATRIBUTOS SERVER E DATABASE








































--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Mensagem modificada, julho, 13 2019 - 6:47 AM
Membro registado
2.962 mensagems
Popularité : +89 (91 votes)
Publicado em julho, 22 2019 - 3:47 PM
Hi Adriano,

HModifyDatabaseRights(Myconn,Usermaster,hRightsManageTask,hAllowed,Database) // => não disponível no banco de dados
e você precisa fazer o seguinte:


HModifyDatabaseRights(Myconn,Usermaster,hRightsBackup,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsManageTrigger,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsRead,hAllowed,Database)

etc..
Detalhes:

https://doc.windev.com/en-US/?3044326&lang=fr-FR&productversion=xxF240075n&3044326&lang=fr-FR&productversion=xxF240075n


https://doc.windev.com/en-US/?3044326&lang=fr-FR&productversion=xxF240075n&3044326&lang=fr-FR&productversion=xxF240075n


OK

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Mensagem modificada, julho, 22 2019 - 3:49 PM
Membro registado
2.962 mensagems
Popularité : +89 (91 votes)
Publicado em julho, 29 2019 - 5:51 AM
// Summary: <specify the procedure action>
// Syntax:
//[ <Result> = ] ws_create_database (<Token>, <Nome>, <Email>, <Telefone>, <Database>, <Usermaster>, <PasswordMaster>)
//
// Parameters:
// Token:
// Nome: <specify the role of Nome>
// Email: <specify the role of Email>
// Telefone: <specify the role of Telefone>
// Database: <specify the role of database>
// Usermaster: <specify the role of Usermaster>
// PasswordMaster: <specify the role of PasswordMaster>

Procedure ws_create_database(Token,Nome,Email,Telefone,Database,Usermaster,PasswordMaster)

ok is string

IF Token <> "" AND Token = "abre-ti-cesamo" AND Database <> "" AND Nome <> "" AND Telefone <> ""

HDescribeConnection(MyConnection, Usermaster, PasswordMaster, "MyHFServer",Database, hAccessHFClientServer, hORead)

HOpenConnection(MyConnection)
HChangeConnection("*",MyConnection)

Database.Nome = Nome
Database.Telefone = Telefone
Database.Database = Database
HAdd(Database)

HCloseConnection(MyConnection)

Myconn is Connection
Myconn..Server = "localhost"
Myconn..User = "admin"
Myconn..Password = "jujuba110287"
Myconn..Database = Database
Myconn..Provider = hAccessHFClientServer
IF HOpenConnection(Myconn) = True THEN
IF HChangeConnection("*",Myconn) = True THEN
HModifyStructure("*")
HCreationIfNotFound("*")
ok = "Database criada com Sucesso!"

HUser.Login = Usermaster
HUser.Password = PasswordMaster
HUser.FullName = Nome +" / "+ Usermaster
HUser.Email = Email
HUser.Phone = Telefone
HUser.Groups = "ClientWebDev"
HUser.EnabledAccount = True


IF HAddUser(Myconn) = True THEN
ok += " = Usuario: "+Usermaster+" foi atribuido ao Banco de dados"
END

IF HModifyUser(Myconn,Usermaster) = True THEN
ok += " = Usuario: "+Usermaster+" foi atribuido ao Banco de dados"
END


HModifyServerRights(Myconn,Usermaster,hRightsChangePassword,hAllowed)
HModifyServerRights(Myconn,Usermaster,hRightsChangeRights,hAllowed)
HModifyServerRights(Myconn,Usermaster,hRightsCreateDB,hAllowed)
HModifyServerRights(Myconn,Usermaster,hRightsManageUser,hAllowed)
HModifyServerRights(Myconn,Usermaster,hRightsSeeUser,hAllowed)
HModifyServerRights(Myconn,Usermaster,hRightsManageServer,hAllowed)


HModifyDatabaseRights(Myconn,Usermaster,hRightsCreateFile,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsRead,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsInsert,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsUpdate,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsDelete,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsDeleteDB,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsDeleteFile,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsBackup,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsManageTrigger,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsAutoModif,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsChangeLink,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsChangeOwner,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsChangeRights,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsConnection,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsCreateView,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsDebug,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsEncryptedConnection,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsLock,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsMaintenance,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsManageDuplicate,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsManageIntegrity,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsManageProcedure,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsManageTask,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsNoDatabaseAccess,hAllowed,Database)
HModifyDatabaseRights(Myconn,Usermaster,hRightsRunProcedure,hAllowed,Database)

ok += ", Diretivas adicionadas com Sucesso!"

HCloseConnection(Myconn)
END
END

END

arrResultado is array of string

Add(arrResultado,ok)

RESULT ok


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Mensagem modificada, julho, 29 2019 - 5:58 AM