Delphi Rewrite Error 103
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings i/o error 103 delphi and policies of this site About Us Learn more about Stack Overflow delphi io error 103 the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation what is i/o error 103 Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it
I/o Error 103 Windows 7
only takes a minute: Sign up How do I solve I/O error 103 in delphi up vote 2 down vote favorite So Basically I'm in College in the UK (So that's school for Americans (17 years old)) and I have to make a file handling project for my finals. I have done most of it but it's the login screen that i/o error 103 realterm is weighing me down a lot. What I want from the program to do is read the username and password and log the people in. There can be 2 different outputs. If you type in "Staff" in the username and "warwickschool2013" in the username, the program takes you to the "teacher" side of the program where they can add in new users. unit LoginScreen; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, jpeg, ExtCtrls; type TfrmLogin = class(TForm) lblWelcomeLogin: TLabel; edtPassword: TEdit; lblPassword: TLabel; btnLogin: TButton; btnClose: TButton; lblCounter: TLabel; lblAttempts: TLabel; Image1: TImage; edtUsername: TEdit; lblUserName: TLabel; procedure btnCloseClick(Sender: TObject); procedure btnLoginClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var frmLogin: TfrmLogin; implementation uses MainMenu, TeachersMainMenu, ViewEditTheData, Globals_Unit; var LoginDataArray: array of TLoginData; counter: integer; Password, username : String; Count1, Count2 : integer; Temp: TLoginData; {$R *.dfm} procedure TfrmLogin.btnLoginClick(Sender: TObject); var SearchName : string[10]; SearchCode : string[3]; begin Password:=edtPassword.Text; UserName:=edtUserName.Text; btnclose.enabled:= true; if (Password = 'warwickschool2013') AND (Username = 'Staff') then begin edtPassword.text :=''; frmTeachersMainMenu.show; frmLogin.hide; counter:= 0; lblCount
f: TextFile;) The Line with Rewrite crashes with I/O Error 103: ERROR_TOO_MANY_SEM_REQUESTS (The semaphore cannot be set again.) What does that mean?? What is wrong? Thanks, Philipp Adam Fli Delphi Developer Wed, 26 May 2004 00:14:06 GMT Re:I/O what does i/o error 103 mean Error 103 I/O Error are not the same as Win32 Errors. This is Run Time Error
I/0 Error 103
as named in old Borland Pascal. The number 103 means File Not Open, but it is not predicted to apear on rewrite function.
I/o Error 103 Screensaver
Please check if it is on this function. I belive that file is not created correctly and so it is not opened. You may send more code too, that i can se what can be wrong. Adam Quote"Philipp Crocoll"
ReWrite causes the error "I/O error 32 trying to open C:\Temp\Temp001.TXT". to pop into the memo box. Var FNbr: integer; Const EditorPgmPath = 'C:\Program Files\Microsoft http://www.delphigroups.info/2/10/1004385.html Office\Office10\winword.exe'; procedure TForm1.Button5Click(Sender: TObject); var F: TextFile; stpath1, stpath2: string; iError: integer; begin Inc(FNbr); http://embarcadero.newsgroups.archived.at/public.delphi.nativeapi/201003/1003033518.html stPath2 := Format('C:\Temp\Temp%3.3D.TXT',[FNbr]); AssignFile(F,stpath2); {$I-} ReWrite(F); iError := IoResult; {$I+} If iError <>0 then Memo1.Lines.Add(Format ('I/O error %D tring to open %S.',[iError,stPath2])) // Ex: I/O error 32 trying to open C:\Temp\Temp002.TXT // Using "C:\>net helpmsg 32" gives // "The process cannot access the file because it is being // used by another process." error 103 else try{finally} WriteLn(F,'File Path = ' + stPath2); finally CloseFile(F); stpath1 := EditorPgmPath + ' ' + stpath2; iError := WinExec(PChar(stPath1),SW_SHOWNORMAL); if iError < 32 then Memo1.Lines. Add(Format('iError=#%D occurred.',[iError])); end{finally}; end; Wayne Niddery [TeamB] Delphi Developer 2006-03-04 05:30:49 AM Re: I/O error 103 John Luetich writes: Quote Here's my code. the tables are Paradox but I don't think it makes any difference with tblzprntid do begin i/o error 103 tmpprnt1 := fieldbyname('prntID').asInteger; tmpprnt2 := tmpprnt1 + 1; edit; fieldbyname('prntID').asInteger := tmpprnt2; post; end; With this code it is very possible for two computers (or even more) to get the same number and this would easily explain the error you are seeing. - Any number of computers could read the current value from the table before any have incremented and written back the new value. - therefore any number can end up writing back the same new value and attempting to use this to write the text file. - whoever launches Word first wins. Sticking with Paradox, you need to set Exclusive to true on the TTable and add calls to Open and Close the table in the above code. Wrap that in a try/except block and, in the case of an exception, wait a bit and try again. -- Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com) RADBooks: www.logicfundamentals.com/RADBooks.html "Democracy, without the guarantee of liberty, is merely a method of selecting tyrants." - Alan Nitikman John Luetich Delphi Developer 2006-03-24 05:39:05 AM Re: I/O error 103 I'm getting another annoying error here, after using tstreams for my text report, and I can not seem to find the cause.
file ERROR 103 Subject: Windows 7 - Write to file ERROR 103 Posted by: Sumerset sumerset Date: Wed, 3 Mar 2010 Hello, I'm trying to write a component that logs the activity of an application. The code works fine in Windows XP and Windows Vista however when i run it in a Windows 7 pc i get a "I/O error 103". Does anyone have this problem and know how to solve it? I'm using Delphi2010 and the following code: Procedure Component.create begin SetCurrentDir(GetCurrentDir); if (not(DirectoryExists('Log'))) then begin CreateDir('Log'); end; SetCurrentDir(GetCurrentDir+'\LOG'); try AssignFile(pLog_file,Time.UTCtimestamp(time.localtoutc(Time.getnowtime))+'.txt'); except closefile(plog_file); end; end; Procedure Component.start; begin try rewrite(plog_file); writeln(plog_file ,utf8string('Log started')); pstate:=stateon; except closefile(plog_file); end; end;Replies Re: Windows 7 - Write to file ERROR 103 [Edit] posted by karl pritchett on Wed, 3 Mar 2010 Newsgroups.Archived.At is © Copyright 2009-2016, A B Cryer, All Rights Reserved.