dbexpress driver does not support the tdbxtypes.unknown data type.Vendor error message
08/04/2017
0
Estou tentando alterar alterar os dados de uma tabela, para poder inserir notas, através do update. Que antes do usuário cadastrar as notas, ele deve cadastrar o aluno, sendo assim teria que dar um update para poder inserir as notas. Segue o código.
Mas está dando o seguinte erro: "dbexpress driver does not support the tdbxtypes.unknown data type.Vendor error message", quando clico em salvar.
Estou usando o SQLQuery com o SQLConection.
CHAMANDO O METODO NO ON CLICK
procedure TForm3.BBSalvarClick(Sender: TObject);
Var
ObjInsereNota: TPessoa;
Codigo: Integer;
begin
ObjInsereNota := TPessoa.Create(SQLQuery1);
ObjInsereNota.Notas[0] := StrToFloat(EdNota1.Text);
ObjInsereNota.Notas[1] := StrToFloat(EdNota2.Text);
ObjInsereNota.Notas[2] := StrToFloat(EdNota3.Text);
ObjInsereNota.Notas[3] := StrToFloat(EdNota4.Text);
Codigo := StrToInt(EdMatricula.Text);
ObjInsereNota.InserirNotas(Codigo);
End;
MEU MOTODO NA CLASSE PARA FAZER A INSERÇÃO DA NOTA
function TPessoa.InserirNotas(vCodigo: Integer): Boolean;
begin
PQuery.Close;
PQuery.SQL.Clear;
PQuery.SQL.Add('Update Pessoa set');
PQuery.SQL.Add('Nota1 = :pNota1, Nota2 = :pNota2, Nota3 = ´:pNota3, Nota4 = :pNota4, Frequencia = :pFrenquencia');
PQuery.SQL.Add('Where Codigo = :pCodigo');
PQuery.ParamByName('pNota1').AsFloat := Notas[0];
PQuery.ParamByName('pNota2').AsFloat := Notas[1];
PQuery.ParamByName('pNota3').AsFloat := Notas[2];
PQuery.ParamByName('pNota4').AsFloat := Notas[3];
PQuery.ParamByName('pCodigo').AsInteger := vCodigo;
PQuery.ExecSQL;
Result := PQuery.RowsAffected > 0;
end;
Claudinei
Posts
12/04/2021
Geverson Souza
Tente isso.
Espero ter ajudado!
12/04/2021
Emerson Nascimento
Clique aqui para fazer login e interagir na Comunidade :)