Intraweb - web application - users sessions - delphi

Today I started to write my first web application and I can't pass one step.
Everything works almost fine... I can connect to the server and open website. Problem is when I open browser and type the same address on the second pc, then I get te same data as on the first one.
Detailed...
Application has two forms, first is for login, and second one is for receiving data.
When I login on the first pc and second form shows up, and then I open browser and put the address of the server on the second pc, I see the second form after login from first pc.
What I should do in this case? I tried to find the solution in the net, but I couldn't :(

If you are using any Delphi IDE after XE3 (including) and using the IntraWeb edition that comes with Delphi you must upgrade in order to have it working correctly. It is free, and more information can be obtained here:
http://atozed.com/IntraWeb/Download/FreeKeyRequest.EN.aspx|
After upgrading (if this is your case) I suggest you to take a look at one of the IntraWeb demos, here:
https://iwdemos.codeplex.com/SourceControl/latest
There is a demo named Features that shows you exactly how to create a multi form application. To be honest, I work with IntraWeb for a long time and I've never seen that. Unless you are using some global var to hold your "current" active form. Have in mind that IntraWeb is a fully multithreaded application and global vars should not be used, unless you have some mechanism protecting concurrent access (but you should get rid of them and use ServerController properties instead).

Thnks for your quick reply.
I work with Delphi from some time, but I never used Intraweb, I worked with ComPort and IP works for I/O devices. I have XE7 and I upgraded Intraweb to 14.0.52.
I can't find a good file exchange server to put my application for sharing with you. If I find somethin I will post it below.
You can check the code and other settings of my simply project. I put the web application inside the link below, it is without the .exe file.
https://www.dropbox.com/s/75zurcew0zr363x/Project1.rar?dl=0
Thanks for your help.

Related

Unable to access SQL table from appl running as service

I have a small test application, made with Delphi 10.3.1 as an Stand Alone HTTPSYS Intraweb service. It has an ADOConnection and a ADOTable and in FormShow of unit1, I open the connection, and the table and reads the first 10 rows and add them to a listbox. Just to see that it works and is possible.
When running the application as a Stand Alone HTTPSYS, vith visual GUI, it's working nicely, but when I compile it as a service, and install it, on the sql server, or on the development machine, it fails with access Violation, trying to open the table. I suppose it is an Authentication problem.
I have tried to open connection with both Windows Auth, and with a specific SQL login, and I have tried running the service with both local system (default) and with the specific SQL account.
What am I missing ?
The Specific SQL login, works in SSMS. I'm able to use it to login and access my tables.
Also, if I create the application as a DLL and put it on my IIS10, it works fine.
You are right. It has nothing to do with authentication.
For the IntraWeb HttpSys Stand Alone program to run as a service, the ServerController.ComInitialization property must be set to ciMultiThreaded.
Thanks for your comment which lead me to look elsewhere. You do deserve the credit.
Regards
Soren

How do I compose an email for Office365 using Delphi?

I need information on how to allow an end user to compose an email, in Delphi code. Our Delphi version is Delphi Seattle (I think that is 10.1?) We use office365 as our email program. I need to pre-fill the recipient and some html in the body of the email. The end-user needs to complete the body of the email then click the send button.
We used to use the reliable "mailto" commandline that then displayed an email form. But it only works with plain text, no html. I now need to have html in the body of the email. I switched to using the ancient semi-reliable TOutlookApplication component and using it in code to do this thru OLE. I do see a dialog pop up, and the html appears to render correctly, but the send button seems to do nothing. Looking at the code used by TOutlookApplication, it appears that it's not been updated since the glory days of XP.
I am using Delphi Seattle. I don't think I can use Indy components with stmp because the email dialog has to be present to allow for the composing of the email, and I didn't see a way for Indy to display the form. Can anybody please tell me what I gotta do to make this work? If anybody wants to see my current code using TOutlookApplication, I can post it, but it's like 1,000 other Delphi examples of the component. Surely, others have overcome this, right?
I have additional information on this. I was running my application on a virtual machine, but my outlook was running in the desktop. Once I run the application on the desktop, it ran fine. I even received the test emails I hadn't from the vm. I believed the vm was aware of the desktop applications. My bad!
The problems I experienced were due to running on a virtual machine. If there are other dolts trying to run an app that uses OLE to access Outlook from a VM, make sure you have a Outlook ON THE VM. Or run your app from the someplace that has Outlook installed, like a desktop.

How to fix lost connection to Access Database after Deploying ASP website to IIS?

I am fairly new to ASP, so if anything doesn't make sense, or you think, "WHY WOULD YOU DO THAT?", it's becasue I really didn't know.
So the issue is that I created a Website using Visual Studio 2012 Express for Web. It was an ASP.NET MVC. I have spent over a week, working on this, doing testing and getting everything to work and look correctly. So I started the process of deploying it. I followed a couple guides, and felt like I did everything correctly.
Right now I am only trying to test my website on , and my first screen shows up. This screen is a "login" screen of sorts and is supposed to connect to my Access Database to check to see if a user should be admited to the next screen. But clicking the "Submit" button doesn't even open the Database. All of this works fine when I run it in Visual Studio.
What can I do to get this working?
Some steps I have tried and failed at:
-Redeploying
-Changing location of the Access DB
-I started to try to install configure and convert my Access Database to SQL Server, but I haven't been able to get that to work either.
If anyone has any suggestions, please let me know. If you need code examples or IIS settings, I will get them to you as fast as I can, but please help me because I don't want to have lost over a week of work.
Thanks,
D
Edit: After taking the suggestion from HansUp, it lead me to some other search terms that lead me to http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-classic-asp-with-microsoft-access-databases-on-iis. I am using a 64-bit machine, and my application pool in IIS was not set to run 32-bit applicaions which when using Access ODBC drivers that are 32-bit casue a problem.
Set the IUSR account to Read/Write for the DB file and folder where the DB file is located.
Then, seeing as I was using a 64-bit machine, and the Access ODBC drivers that were being used were 32-bit, I had to set "Enable 32-bit Applications" to "true" in IIS, for the Application Pool that my site was using.
This is a link to where I found the 64-bit 32-bit solut
http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-classic-asp-with-microsoft-access-databases-on-iis

Why am I getting the message "The specified request cannot be executed from current Application Pool"?

Quite not sure why I see this error.
I navigate to my Login View like so http://test.staging.com/mywebsite/Login
My Login view was just redone using MVC but I have seen this same error message going to an aspx page as well...
If I use http I get the error message The specified request cannot be executed from current Application Pool.
If I use https://test.staging.com/mywebsite/Login, I'm good.
If I don't specify a protocol, test.staging.com/mywebsite/Login, I get the error as well
Is there an error happening under the covers and my custom error page can't be shown like discussed here?
What are some other causes of this error?
That usually means your custom errors are configured to run as a different AppPool.
You can read more at MSDN. (See section "Using Custom Errors from Another Application Pool").
There are two ways to correct this behavior. The first is possibly not one that you are interested in because it would require you to change your current architecture and run both sites in the same application pool (such as share the same worker process memory space). To do this, simply move the /errors virtual directory to run in the same application pool as the site for which it serves the custom error.
The second way is to make use of a registry key provided by IIS 6.0. This registry key makes sure IIS 6.0 does not check the metadata during the execution of the custom error and therefore allowing this to work.
See the article for information on the registry key fix.
It may also mean that you are using something along the lines of Server.Transfer to a page that is in a different AppPool.
It could be because you're using different versions of ASP.NET for one or many apps in the pool.
Make sure all apps in the pool use the same version of ASP (e.g. ASP 2.0.50727)
If you just added a new app, try changing the app momentarily to a different version of ASP, then back to same version. I experienced an issue where the displayed version was correct, but under the hood, a different version was used!
Check your event log, under Application, to get more details about the error.
The message would be caused by your page server-side redirecting to a page served by another application pool. Such as for example, in your link, the error page.
I know this is an old thread, but I stumbled upon it and found a different solution. Here's what worked for me: Make sure your application handles .asmx files correctly
From IIS:
Right Click on your project > Properties > Configuration
If necessary, add the .asmx file extension that maps to the aspnet_isapi.dll
Limit to: "GET,HEAD,POST,DEBUG" and restart.
Because I can't comment on vcsjones's answer, I'll add it down here. The DWORD value IgnoreAppPoolForCustomErrors needs to be set under HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\ Parameters vs HKLM\SYSTEM\CurrentControlSet\Services\W3SVC referenced in that technet article. Set it to 1 and do an iisreset and you're good to go.
Source Blog Post
In my particular case, I received this error while trying to serve a content (non ASP.NET) website while it was an Application. Right-Clicking the virtual folder and removing the application fixed it for me.
In my case the application used the application pool that didn't exist. I have no idea how it's happened.

ActiveX Control always working on my machine - unpredictable behavior on others?

I have a question about my ActiveX control not always working in IE on other machines.
Context: I'm working on an internal app for my company. It is designed to be a standalone web-page config tool for viewing a static customized version of our web app. The user may select the colors, images, and other settings they would like to see, and these will be present in the static mockup/preview version on their machine when they click a button.
Implementation: my javascript file creates a filesystem/activex object that essentially creates a temporary javascript file to which a list of values are written. Then when the user previews the configuration, the javascript file is located and values are loaded dynamically into the dom, etc etc. Naturally this functionality only works in Internet Explorer and is shady at best, but is my only way of implementing a purely zero configuration, client-side dynamic webapp.
Problem: When I test out my script, Internet Explorer prompts me twice about ActiveX controls and I say "yes" to them and the ActiveX functions work. I do this every single time I open my page. But sometimes when I send the file to another person so they can use it, they don't get the notifications so it doesn't work. However sometimes they do get notifications and it does work! I am using default security settings for IE so there should be no difference between my settings and theirs.
Could this be related to my user permissions vs theirs, or the fact that the files are read-only (because they are coming from source control and are also being made read-only when put on the shared drive.) or unknown dark Microsoft forces beyond human comprehension?
Thanks,
Josh
I believe you may want to create an HTA (HTML Application) instead of a web page. Writing HTA's gives you more privileges as far as ActiveX objects are concerned. Check out this page from Microsoft: http://msdn.microsoft.com/en-us/library/ms536496(v=vs.85).aspx.
To answer your question about privileges, I believe that some of your coworkers' IE settings probably prevent web pages from using ActiveX objects. Your settings may be such that you are prompted whenever ActiveX object are about to be created.

Resources