Database access....

Dude seriously use google, when you get a compile error you can't fix you google, in your case I googled:

delphi Dataset not in edit or Insert Mode

and got:

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20998091.html

It says you need a account but just scroll right to the bottom of the page and you'll see some comments pasted there, it was a solution for the guy who had a similar problem.

EDIT: Also the database FarligOpptreden posted is solid so if you haven't got a good database already you should use that one, to get the Primary Key of the last inserted row you can simply execute a SELECT @@IDENTITY scalar query on the database.
 
Last edited:
ok thanks... i tried googling and I also founf that site but it didnt show me the comments it kept showing the reg link.
 
Ok i tried googling this but nothing.. I want to write what ever is displayed on my richedit( Which is text from multiple edit.text) to a textfile..
here is my code but it doesn't work , the program crashes.

var
ArrMoSales: Array[1..6] of string;
iMoSales : integer;
sMosales : string;
MyFile : textfile;

begin


ArrMoSales[1] := 'Movie Name ' + edtMovie.text;
ArrMoSales[2] := 'Movie Ganre ' + edtMoviegenre.text;
ArrMoSales[3] := 'Movie Age ' + edtMovieAge.text;
ArrMoSales[4] := 'Movie Price ' + edtMoviePrice.Text;
ArrMoSales[5] := 'Quantity ' + edtMQuan.Text;
ArrMoSales[6] := '';

for iMoSales := 1 to 6 do
begin
frmMusicData.redNewMo.lines.add(ArrMoSales[iMoSales]);
end;

Assignfile(Myfile,'New Stock.txt');
if FileExists('New Stock.txt') <> true then
ReWrite(Myfile) else
Append(Myfile);
sMoSales := (ArrMoSales[iMoSales]);
Writeln(MyFile,sMoSales);
CloseFile(MyFile);
 
Top
Sign up to the MyBroadband newsletter
X