Jump to content

hendrang

Members
  • Posts

    55
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by hendrang

  1. Hello Farshad Mohajeri, Thank you for your help. It works with critical sections. I have another question. Is it possible to reject / terminate concurrent call a procedure/function, in this case not using critical section. I mean the second client call for the procedure/function will be informed that the procedure/function is being called by other client. Thanks
  2. Hi All, How to prevent a procedure/function been called simultaneously by 2 or more clients ? I use a global variable as a flag. code like this : var isCalled: Boolean; // Global variable function TMainForm.UpdateData: Boolean; begin if isCalled then Exit(False); // exit cause this function is being called by other client isCalled:= True; . <my code> <my code> . isCalled:= False; // set isCalled to False in order other client can call this function Exit(True); end; It works but I think this is not safe because there is still possibility this function been called simultaneously if this function is called at the same time by two or more clients. is there any other way ? Thanks in advance. Hendra
  3. Hello Docjones, I works, problem solved. Thanks for your help.
  4. My application project : uniGuiAndDataSnap.rar
  5. Hi all, My unigui apps call a simple function in a Datasnap application simultaneously. I am using Delphi XE. the function in Datasnap is: function TServerMethods2.RetValue(aVal:Integer): Integer; begin Sleep(1000); // pause execution for simulating simultaneous execution Exit(aVal); end; the function just return back the parameter value, no other calculation. and the code to call the RetValue function in uniGui application : procedure TMainForm.UniBitBtn1Click(Sender: TObject); var i,x: Integer; begin UniListBox1.Clear; for I := 1 to 10 do begin x:= ClientModule1.ServerMethods2Client.RetValue(i); UniListBox1.Items.Add(IntToStr(x)); // Return value in listbox end; end; and the correct result is : but if I call the DataSnap function simultaneously by opening the uniGui in two firefox tabs, it retuns variety wrong value. How can I solve the problem and thanks in advance. Thanks Hendra
  6. Hi All, Please help. I am newbie in Web Application I want the ClientEvent OnClick Execute ajaxRequest with EventName depend on an variable value declare in MainForm For example : Salary is variable declare in MainForm function OnClick(sender, e) { if (Salary < 10000) { ajaxRequest(sender, 'Event1'); } else { ajaxRequest(sender, 'Event2'); } } Please help me to correct the function above. Thanks in advance.
  7. Hi, Firebird server run on 2.22.22.222 (Web server) and 3.33.33.333 (client computer) Maybe Firebird server need not run on 2.22.22.222 (Web server) cause Database now on 3.33.33.333, I will test it later. I use Anydac not ADO, not configure and test the ODBC driver.
  8. Disable firewall solve the problem. I have to disable Windows Firewall and firewall of anti virus Eset Smart Security on the client computer. My uniGui Web Application can connect remote database.
  9. Hi, thanks and sorry for my late reply. Yes I can ping db Server(client computer) from web server and vice versa. And the process connecting database is done in client computer, this mean the user in client computer try to connect his local database. I also try to remote connect the client database (I can ping the client computer) from my computer with Desktop application (create with VCL Delphi not uniGUI) but failed either. the error message is : Unable to complete network request to host 'xx.xx.xxxx' <- client ip address failed to establish a connection. I used to be able remote connect the client database use the desktop application but now fail to connect. So I think this is not because of UniGUI application, but network connection problem. I use Logmein Hamachi to connect client computer.
  10. Hi All, I am using AnyDac component and firebird database. Suppose that the Web Server IP Address is 2.22.22.222 and the web application want to connect database reside in client computer (IP Address 3.33.33.333) with code like this : idx:= ADConnection1.Params.IndexOfName('Database'); ADConnection1.Params[idx]:= 'Database= 3.33.33.333:C:\Employee.fdb'; ADConnection1.Connected:= True; raise Ajax Error : Server unavailable My plan is not to host the web application and the database in the same computer. as I read article Database Security Best Practices : Separate the Database and Web Servers so that mean the web application computer and database server computer will have different IP Address. Thanks in advance.
  11. Hi, Yes, it works use unisession.sendstream no need save the file excel to server then download to client.
  12. Hi Irwan, thanks for reminding me. I already saw demo samples before but I forget there are these download demo samples. Regards, Hendra
  13. Ok, I will try it in my client computer tomorrow unisession.sendfile act like download file so client user may should open the file first and then save it to the target directory. Thanks.
  14. Hi Gerhard Kimmeringer, Thank you for your help. I am new in web application, can you kindly help what the code in my case use UniSession.SendFile Method, I am using NativeExcel. Suppose the client user want to save the excel to directory C:\Reports In desktop application the code is : WorkBook.SaveAs('c:\Reports\Report.xls'); Regards, Hendra
  15. Hi All, My application need to convert data to Excel file and save the Excel file to client computer (harddisk/flash disk). Can web Application save the Excel to Client Computer ? with code : WorkBook.SaveAs('c:\Report.xls'); the report.xls will be saved in web server harddisk not in the client harddisk. Thanks in advance
  16. Hi All, uniDBGrid has a different behavior in editting a cell value between desktop and web mode. In desktop mode, in a selected cell we can just type a new value then the selected value will be overwrite, but in web mode before typing we should type Enter key to unselect the cell value. How can I change this behavior so in web mode dbgrid can be like in desktop mode ? thank in advance Sorry for my bad english.
×
×
  • Create New...