sax15
Computer
- Oct 20, 2005
- 2
Hallo,
I have some problems with saving a long text (longer then 255 characters) into MS Access database.
When I want to save it, the error screen pups up and it contains:
[0] General SQL error.
[Microsoft][ODBC Microsoft Access Driver] Invalid descriptor index
[Microsoft][ODBC Microsoft Access Driver] Invalid precision value
The data base is MS Access 2000: field ôtestö is defined as ômemoö. I am using Delphi 6, ODBC 5.2, TQuery:
Code for saving:
procedure TaOrganizacija.Button1Click(Sender: TObject);
var
sql_niz: String;
begin
sql_niz:='INSERT INTO organizacije (test) VALUES
test) ';
QOrg.Close;
QOrg.DatabaseName:=sys_dbalias;
QOrg.SQL.Clear;
QOrg.SQL.Add(sql_niz);
QOrg.ParamByName('test').AsString:=mOpomba.Text;
Try QOrg.ExecSQL;
Except
On E: Exception Do
begin
ShowMessage('['+inttostr(E.HelpContext)+'] '+E.Message+#13#10);
end;
End;
end;
The error occurs if I want to save in this field text, longer then 255 characters.
If I use QOrg.ParamByName('test').AsMemo:=mOpomba.Text; , the error screen pups up and it contains:
[0] General SQL error.
[Microsoft][ODBC Microsoft Access Driver] String data, right truncated (null).
If the text is shorter than there is no problem. If anyone already had similar problems, I would be thankful if you could share the solutions. Any kind of tips would be helpful.
Thanx
SaX
I have some problems with saving a long text (longer then 255 characters) into MS Access database.
When I want to save it, the error screen pups up and it contains:
[0] General SQL error.
[Microsoft][ODBC Microsoft Access Driver] Invalid descriptor index
[Microsoft][ODBC Microsoft Access Driver] Invalid precision value
The data base is MS Access 2000: field ôtestö is defined as ômemoö. I am using Delphi 6, ODBC 5.2, TQuery:
Code for saving:
procedure TaOrganizacija.Button1Click(Sender: TObject);
var
sql_niz: String;
begin
sql_niz:='INSERT INTO organizacije (test) VALUES
QOrg.Close;
QOrg.DatabaseName:=sys_dbalias;
QOrg.SQL.Clear;
QOrg.SQL.Add(sql_niz);
QOrg.ParamByName('test').AsString:=mOpomba.Text;
Try QOrg.ExecSQL;
Except
On E: Exception Do
begin
ShowMessage('['+inttostr(E.HelpContext)+'] '+E.Message+#13#10);
end;
End;
end;
The error occurs if I want to save in this field text, longer then 255 characters.
If I use QOrg.ParamByName('test').AsMemo:=mOpomba.Text; , the error screen pups up and it contains:
[0] General SQL error.
[Microsoft][ODBC Microsoft Access Driver] String data, right truncated (null).
If the text is shorter than there is no problem. If anyone already had similar problems, I would be thankful if you could share the solutions. Any kind of tips would be helpful.
Thanx
SaX