<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — [SOLVED] Weird application error messages at login]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=7249</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=7249&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [SOLVED] Weird application error messages at login.]]></description>
		<lastBuildDate>Sun, 03 Jan 2021 08:10:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] Weird application error messages at login]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=39616#p39616</link>
			<description><![CDATA[<p>Problem solved by deleting the DCU file and recompiling.&nbsp; XMLEditor reported an invalid token in the dcu file.</p>]]></description>
			<author><![CDATA[null@example.com (CDB)]]></author>
			<pubDate>Sun, 03 Jan 2021 08:10:59 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=39616#p39616</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Weird application error messages at login]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=39615#p39615</link>
			<description><![CDATA[<p>I&#039;ve attached a snipshot of the _user table.&nbsp; </p><p>So myself &#039;admin&#039;, and &#039;kerian&#039; can log in with no problem, if I impersonate any of the others I get the above runtime error.</p>]]></description>
			<author><![CDATA[null@example.com (CDB)]]></author>
			<pubDate>Sun, 03 Jan 2021 07:34:19 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=39615#p39615</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] Weird application error messages at login]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=39614#p39614</link>
			<description><![CDATA[<p>I have made some minor alterations to a program that runs.</p><br /><p>1. added a new form&nbsp; and code for that form.</p><br /><p>2. added code to an existing method that&nbsp; reads and deletes an entry in the database.</p><br /><p>Application compiles with no errors, and I can log on to the program using my login and one of the other users. However out of 12 users in the database only my login and one other now works.</p><br /><p>If I try to log in as the other users I get the following two message boxes and two instances per user attempted login of the application appear in Task Manager with a CPU usage of 100%.&nbsp; </p><br /><p>Error message 1:<br /><strong>Exception EListError in module workshopPartsDB.exe at 000BC592.&nbsp; List index out of bounds (7).</strong>&nbsp; when I click OK, the second message pops up</p><br /><p>Error message 2:<br /><strong>Access violation at address 00E3A5C8 in module &#039;workshopPartsDB.exe&#039;. Read of address 00000000</strong></p><br /><p>Does anyone have any idea what list index the application is suddenly having a problem with?</p><br /><p>It is really weird that the only two users that can log in are the<strong> first two</strong> in the database, <strong>user_ID 3 to 12</strong> cause this problem.</p><br /><p>The added code which is now commented out:</p><div class="codebox"><pre><code>procedure frmMain_tgLogged_OnCellDoubleClick (Sender: TObject; ACol, ARow: Integer);
var
  logName : string;
begin
       logName := SQLExecute(&#039;SELECT username FROM user_log WHERE username =&quot;&#039; + Application.User.Username + &#039;&quot;&#039;); 
      showmessage(logName);
      { if Application.User.Username = logName then
         MessageBox(&#039;You cannot FORCE your own logout &#039; +  #13#10#13#10 + &#039;Please select another user or close the program normally.&#039;,&#039;Logout Problem  &#039; + Application.User.Username,MB_OK+MB_ICONERROR)
       else
       begin  
         SqlExecute(&#039;Delete FROM user_log WHERE id = &quot;&#039; + frmMain.tgLogged.sqlValue + &#039;&quot;&#039;);
         frmMain.tgLogged.dbUpdate;
       end;}
end;</code></pre></div><br /><p>The code for&nbsp; the new form:</p><div class="codebox"><pre><code>procedure frmChangePartNumber_btnNewPartNo_OnClick (Sender: TObject; var Cancel: boolean);
begin
     sqlexecute(&#039;UPDATE products SET  LineNumber = &quot;&#039;+frmChangePartNumber.edtNewPartNo.text+&#039;&quot; WHERE id = &#039;+IntToStr(frmEditPart.grdEditPart.dbItemID));
     frmEditPart.grdEditPart.dbUpdate;
     //showMessage(&#039;After update &#039;+ frmEditPart.grdEditPart.Cells[0,rowSelect]);
     frmEditPart.lbLineNo.Caption := frmChangePartNumber.lbCurrentPartNo.Caption;
     frmChangePartNumber.Close;

end;

procedure  frmChangePartNumber_edtNewPartNo_OnExit(Sender: TObject);
var
    buttonSelected: integer;
    lngth : integer;
begin

  lngth :=  Length(frmChangePartNumber.edtNewPartNo.text); //check how many digits have been entered

  if (frmChangePartNumber.edtNewPartNo.Text = &#039;&#039;) or (frmChangePartNumber.lbCurrentPartNo.Caption = frmChangePartNumber.edtNewPartNo.Text) then
  begin
   MessageBox(&#039;No Changes have been made&#039;,&#039;INFORMATION&#039;,0);
   frmChangePartNumber.edtNewPartNo.SetFocus;
   end
   else {entry must be a seven digit number}
   if lngth &lt;&gt; 7 then
   begin
     messageDlg(&#039;Part Number must be 7 digits long&#039;,mtError, mbCancel, 0);
     frmChangePartNumber.edtNewPartNo.SetFocus;
   end;
 

  if frmMain.edtInternalNumber.text = sqlexecute(&#039;SELECT  lineNumber FROM products WHERE lineNumber = &quot;&#039;+frmChangePartNumber.edtNewPartNo.text+&#039;&quot;&#039;) then
  begin
    buttonSelected := messageDlg(&#039;WARNING Part Number already exists&#039;,mtWarning, mbOK+mbRetry, 0);
    if buttonSelected = mrRetry then
     //frmMain.edtInternalNumber.Clear
      frmChangePartNumber.edtNewPartNo.SetFocus
    else
     exit;
  end;   
end;

procedure frmChangePartNumber_OnShow (Sender: TObject; Action: string);
begin
    frmChangePartNumber.edtNewPartNo.Clear;
    frmChangePartNumber.lbCurrentPartNo.Caption := frmEditPart.lbLineNo.Caption;
    frmChangePartNumber.edtNewPartNo.SetFocus;
end;

procedure frmEditPart_lbLineNo_OnDoubleClick (Sender: TObject);
begin
   if frmEditPart.lbLineNo.Caption &lt;&gt; &#039;LineNo&#039; then
       frmChangePartNumber.Show;
end;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (CDB)]]></author>
			<pubDate>Sun, 03 Jan 2021 07:19:13 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=39614#p39614</guid>
		</item>
	</channel>
</rss>
