I am not managing to carve a textbox he was seeing sql with insert. In properties it was defined that the only accepted textbox numbers, which it has 2 decimal houses and which the separation takes as a thousand. I tried already with replace, floattostr (textbox) etc. and without success. Can anybody help?

I am using the MVD 3.1

Não sou programador e nem trabalho na área, mas me considero um auto-didata e consegui desenvolver o projeto abaixo, com tudo que aprendi neste fórum. Parabéns ao Dmitry por ter desenvolvido essa excelente ferramenta de programação, que é o MVD.

https://www.youtube.com/watch?v=BKr2gBA … e=youtu.be

103

(8 replies, posted in General)

Please, I ask the one who will be able to help and to a desenvolvedor, which gives support for the forum, as I can compare a date he was seeing script. The filter used in the button SEARCH with the operator> = for the least date is lowered by me, IT DOES NOT WORK.

procedure frmComissoes_OnShow (Sender: string; Action: string);
begin
   frmComissoes.dtIni.datetime := strtodate(SQLExecute('SELECT strftime("%d/%m/%Y",MIN(Data_Venda)) FROM Vendas'));
   frmComissoes.dtFim.datetime := strtodate(SQLExecute('SELECT strftime("%d/%m/%Y",MAX(Data_Venda)) FROM Vendas'));
end;

104

(21 replies, posted in General)

Please, how can I use the procedure shown by Dmitry and select the fields that will not be clean?

var
  alterado: boolean = False;

procedure form4_Edit3_OnChange (Sender: string);
//*** flag que alteracao foi feita no campo
begin
    alterado := true;
end;


procedure Form4_OnShow (Sender: string; Action: string);
//**** desabilita todos os icones do sistema no formulario: fechar, minimizar e maximizar
begin
  Form4.BorderIcons:= 0;
end;


procedure form4_Button2_OnClick (Sender: string; var Cancel: boolean);
//*** evita sair sem gravar - botao de fechar tem que estar como "no action"
begin
    if alterado = false then Form4.Close;
    if alterado = true then
    if 6 = MessageDlg('Cancela alterações', mtConfirmation, mbYes + mbNo + mbCancel, 0) then
    Form4.Close;
end;

begn
end.

106

(14 replies, posted in FAQ)

KEY DUPLICATE

Mathias, obrigado pela informação. Eu usei a função no MVD 2.8 e funciona. Entretanto, ela não funciona quando estou inserindo um novo registro num formulário que tem um tablegrid (registros filhos). Quando tento gravar o registro, após a inserção de registros no tablegrid, o MVD dá a mensagem que a chave já existe. Eu entendi que o MVD primeiro grava o registro pai antes de inserir o registro filho no tablegrid....

Você tem alguma sugestão para esse caso? Obrigado.

Eu usei o trigger abaixo, que encontrei na internet e funcionou. Achei o de insert na Internet e criei o de update:

CREATE TRIGGER [nf_duplicada_update] BEFORE UPDATE ON [Vendas] WHEN [OLD].[Nota_Fiscal] <> [NEW].[Nota_Fiscal]
BEGIN
  SELECT RAISE(ABORT, "Nota Fiscal já existe")
  WHERE  EXISTS (SELECT *
         FROM   [Vendas]
         WHERE  [Nota_Fiscal] = [NEW].[Nota_Fiscal]);
END;

CREATE TRIGGER [nf_duplicada_insert] BEFORE INSERT ON [Vendas]
BEGIN
  SELECT RAISE(ABORT, "Nota Fiscal já existe")
  WHERE  EXISTS (SELECT C *
         FROM   [Vendas]
         WHERE  [Nota_Fiscal] = [NEW].[Nota_Fiscal]);
END;

107

(3 replies, posted in General)

Estou tendo o mesmo problema!!!! O sistema que desenvolvi com o MVD 2.8, que roda bem sem erros no Windows 7, apresenta a mensagem de erro "access violation at address....." na versão 4.6. Dmitry, preciso da sua ajuda


Dmitry, por favor, responda....até pra dizer que não tem solução...

108

(7 replies, posted in General)

Hello MVD community. I use the procedure below to generate a report. Works well. I use dtIni and dtFim to put the period in the report title. Is it possible to simplify this comparison (> =, <=) with dates?

Or is there another way to put the query date range in the report header?

procedure frmListVendas_bRelVendas_OnClick (Sender: string; var Cancel: boolean);
//****** alimenta relatório padrão lista de vendas a partir do tablegrid
var
    i,c: integer;
    s, YY, MM, DD: string;
    Y,M,D: Word;
    v_dtini, v_dtfim: string;
begin
    s := '';
    DecodeDate(frmListVendas.dtIni.Date, Y, M, D);
    YY := vartostr(Y); MM :=vartostr(M); DD := vartostr(D);
    if length(MM) = 1 then MM := '0'+MM; if length(DD) = 1 then DD := '0'+DD;
    v_dtini := YY+'-'+MM+'-'+DD;   showmessage(v_dtini);
    DecodeDate(frmListVendas.dtFim.Date, Y, M, D);
    YY := vartostr(Y); MM :=vartostr(M); DD := vartostr(D);
    if length(MM) = 1 then MM := '0'+MM; if length(DD) = 1 then DD := '0'+DD;
    v_dtfim := YY+'-'+MM+'-'+DD; showmessage(v_dtfim);
    frmListVendas.bRelVendas.dbSQL := '';
    frmListVendas.bRelVendas.dbSQL := 'SELECT   "Vendas"."Nota_Fiscal", "Vendas"."Pedido", '+
'         strftime("%d-%m-%Y","Vendas"."Data_Venda") as Data_Venda, '+
'         (SELECT strftime("%d-%m-%Y",Min("Vendas"."Data_Venda")) from Vendas where Data_Venda >= '+v_dtini+') as DtIni,'+
'         (SELECT strftime("%d-%m-%Y",Max("Vendas"."Data_Venda")) from Vendas where Data_Venda <= '+v_dtfim+') as DtFim,'+
'         "Clientes"."Clie_Nome", '+
'         "Vendedores"."Vend_Nome", '+
'         "Vendas"."Quantidade", '+
'         "Vendas"."Valor"  '+
'FROM     "Vendas"  '+
'LEFT OUTER JOIN "Clientes"  ON "Vendas"."id_Clientes" = "Clientes"."id" '+
'LEFT OUTER JOIN "Vendedores"  ON "Vendas"."id_Vendedores" = "Vendedores"."id" ';

    c := frmListVendas.TableGrid_Vendas.RowCount-1;

    for i := 0 to c do
    begin
        s := s + ''+IntToStr(frmListVendas.TableGrid_Vendas.dbIndexToID(i)) + ',';
    end;

    if s <> '' then
    begin
        SetLength(s, Length(s)-1);
        //showmessage(s);
        frmListVendas.bRelVendas.dbSQL := frmListVendas.bRelVendas.dbSQL + ' WHERE Vendas.id IN (' + s +') ORDER BY Data_Venda';
    end;
    if (frmListVendas.TableGrid_Vendas.RowCount-1) = -1 then cancel := True;
end;

109

(8 replies, posted in General)

Thank you Derek

110

(8 replies, posted in General)

hello, is it possible to change the language of the message that the MVD displays when a required field is no longer filled?

I'm using versions 2.8 and 4.6.

111

(4 replies, posted in Script)

Olá, eu coloquei o script acima numa aplicação com sqlite e não funcionou....alguma sugestão? Obrigado.

112

(4 replies, posted in Reports)

Hello MVD community! Please, how can I filter a sql report through a defined variable in the script?
I've already tried using '{name_variable}', but it does not work. This only works when referring to a form field in the WHERE clause.

113

(6 replies, posted in General)

Eu tive um problema semelhando com o MVD 4.6. Voltei a desenvolve as telas no MVD 1.46 freeware. Depois, eu vou converter para o 4.6 e aplicar as melhorias dessa última versão.

114

(4 replies, posted in General)

I'm with MVD version 4.6. My table has a "Currency" field with 2 decimal places and a thousand separations. I recorded in this field the value of 243.35, but in the tablegrid it appears only 243.00.

In the sqlite table and in the textbox the value is 243.35, but not in the tablegrid.

Can anyone help? Is this a bug?

115

(4 replies, posted in General)

Eu uso o sqlite expert personal, que é um freeware. Faz tudo no sqlite. Very, very, very good!

Essa instrução funciona no MVD 1.46. Calcula diferença entre duas datas em número de anos, meses e dias. Demorou, mas conseguir montar algo que me atende.


UPDATE Ocorrencias SET
            ano_decorrido = round((julianday('now') - julianday(Data))/365.25-0.5),
            mes_decorrido = round((julianday('now') - julianday(Data)- round((julianday('now') - julianday(Data))/365.25-0.5)*365.25)/30.41-0.5),
            dia_decorrido = round(round((julianday('now') - julianday(Data)- round((julianday('now') - julianday(Data))/365.25-0.5)*365.25))-
round((julianday('now') - julianday(Data)- round((julianday('now') - julianday(Data))/365.25-0.5)*365.25)/30.41-0.5)*30.41-0.5)

WHERE Date('now')>Ocorrencias.Data

117

(4 replies, posted in SQL queries)

A versão free do  Valentina Studio permitir construir graficamente querys, que podem ser copiados e colados no MVD.

118

(3 replies, posted in General)

Please, if anyone can help, thank you. I want to set up a report, but I do not think it will be possible to create it through fastreport, would I have to mount the report via script? Could someone give a suggestion of code? Thank you

Body of the report

Grupo
        Subgrupo
                  Conta - descrição - valor
1.1
   1.1.2
            1.1.1.1 - Conta 1.1  - $ 500,00
            1.1.1.2 - Conta 1.2 - $ 300,00
            1.1.1.3 - Conta 1.3 - $ 200,00
            Total 1                     $ 1.000,00
1.2
   1.2.1
            1.2.1.1 - Conta 1.1  - $ 500,00
            1.2.1.2 - Conta 1.2 - $ 400,00
            1.2.1.3 - Conta 1.3 - $ 250,00
            Total  2                    $ 1.150,00

Resultado  (tot 2 - tot 1)     $    150,00

119

(5 replies, posted in General)

Este exemplo eu já havia baixado e me ajudou na solução de outro problema.

Obrigado, mas a ajuda que pedi no post é para evitar o uso de campo BLOB com imagem, o que aumenta o tamanho do BD.

Eu gostaria era de carregar a imagem em tempo real de um arquivo, quando o registro fosse exibido, a partir do endereço desse arquivo, que estaria armazenado no registro.

please. I need help's file for version free 1.46...

121

(5 replies, posted in General)

pt-br

Que script posso usar para mostrar uma imagem num formulário a partir do endereço - exemplo: c:\folder\imagem.jpg - gravado no registro - cada registro teria um endereço diferente -  sem precisar armazená-la num campo IMAGE e exibí-la através do Dbimage?