Fórum Tabela fecha em mais sem menos #46447
01/09/2004
0
Desde ja agraedco
SO.: XP SP1
Usando Firebird 1.5 e IBX
Titanius
Curtir tópico
+ 0Posts
01/09/2004
Afarias
TransactionTal.Commit;
?? SIM ??
T+
Gostei + 0
01/09/2004
Titanius
var Opcao: Byte; begin if (DataSource1.State in [dsEdit, dsInsert]) and (Modificado) then begin if (DataSource1.State in [dsInsert]) then begin DBEdit25.Text := Form1._UserNomeCompleto; DBEdit26.Text := FormatDateTime(´dd/mm/yyyy "-" hh:mm:ss´, Now); end; if (DataSource1.State in [dsEdit]) then begin DBEdit27.Text := Form1._UserNomeCompleto; DBEdit28.Text := FormatDateTime(´dd/mm/yyyy "-" hh:mm:ss´, Now); end; Opcao := Application.MessageBox(´Este registro foi modificado, deseja salvar as alterações ?´, ´Compounder´, MB_YESNOCANCEL + MB_ICONQUESTION + MB_DEFBUTTON1 + MB_APPLMODAL); case Opcao of ID_YES: IBDataSet1.Post; ID_NO: IBDataSet1.CancelUpdates; ID_CANCEL: Abort; end; end; IBDataSet1.Close; Close;
Gostei + 0
01/09/2004
Afarias
que erro?? qual a mensagem?
|e apos o Post ele parece q trava e fecha a tabela:
bom, estou vendo no código um [b:40c581c7d9]IBDataSet1.Close; [/b:40c581c7d9] o q vc espera q ocorra?
T+
Gostei + 0
01/09/2004
Titanius
Gostei + 0
01/09/2004
Afarias
como vc vê isso???
a propósito, hehehe... aida asssim, que diferença faz se é fechada no post se a próxima linha a ser executada é um Close? :D
Faça um teste... tire a linha onde vc fecha o dataset e verifique se continua ocorrendo isso!
T+
Gostei + 0
02/09/2004
Titanius
A proposito! mais uma perguntinha, saindo desse erro:
Quando abro meu form, eu jah dou um Insert no IBDataSet, ao dar um Insert ele muda automaticamente o Generator indicado... mas tipo, 89¬ das vezes o usuario nao vai inserir, entao fica toda hora incrementando o Generator, a toa... isso vai gerar um numero muito grande...
Ps.Meu chefe quer porque quer, q inicie em novo registro... mesmo que 89¬ das vezes vai ser soh pra ver o registro...
Obrigado!
Gostei + 0
02/09/2004
Afarias
T+
Gostei + 0
02/09/2004
Titanius
porem, volto ao mesmo erro! Me desculpe, mas vou postar o codigo do meu forum aqui, quando dei um Aceitar Mudancas no dbnavigator, ele simplesmente fechou a tabela, e mesmo depois de fechar o programa, e ao tentar abrir o menu novamente, ele para no Open, e nao faz nada...
Codigo que abre o form
var Found, i: integer; begin Found := -1; for i := 0 to Screen.FormCount - 1 do if Screen.Forms[i] is TFrmCadFuncionarios then Found := i; if Found >= 0 then Screen.Forms[Found].Show else begin FrmCadFuncionarios := TFrmCadFuncionarios.Create(Application); with FrmCadFuncionarios.IBDataSet1 do begin Open; First; FrmCadFuncionarios.ComboBox1.Items.Clear; while not EOF do begin FrmCadFuncionarios.ComboBox1.Items.Add(TrimRight(FRmCadFuncionarios.IBDataSet1NOME.AsString)); Next; end; First; // Insert; end; FrmCadFuncionarios.Show; FrmCadFuncionarios.SetFocus; end;
no meu form, nao faco nada, a naum ser no botao de sair:
[code]
var
Opcao: Byte;
begin
if (DataSource1.State in [dsEdit, dsInsert]) and (Modificado) then
begin
Opcao := Application.MessageBox(´Este registro foi modificado, deseja salvar as alterações ?´, ´Compounder´, MB_YESNOCANCEL + MB_ICONQUESTION + MB_DEFBUTTON1 + MB_APPLMODAL);
case Opcao of
ID_YES: IBDataSet1.Post;
ID_NO: IBDataSet1.CancelUpdates;
ID_CANCEL: Abort;
end;
end;
IBDataSet1.Close;
IBDataSet2.Close;
Close;
[/close]
Porem volto a lembrar q ele fecha a tabela cquando clico no V do dbnavigator... e nao abre mais...
Qual o erro?
Gostei + 0
02/09/2004
Afarias
T+
Gostei + 0
02/09/2004
Afarias
T+
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)