title: How do I configure IIS 7 to allow a remote database connection from within an ISAPI Web Server
body: <p>I have a native Web service application (ISAPI) that I have built with Delphi 2010. At this time, it only exposes two methods. The first one, EchoString, is designed to give me feedback that the Web service is functioning properly, and it adds a couple characters to the string that I send to it from my Delphi Web service client. This always works fine.</p>
  
  <p>The second exposed method is the one that I am really interested in. I pass this method a string that contains the XML contents of a ClientDataset. From the server side, my code takes this XML and inserts it into a ClientDataset, after which it posts this data to a server-side database.</p>
  
  <p>I am using IBExpress components (IBDatabase, IBTransaction, IBQuery, etc.) to connect to an InterBase database on the server side.</p>
  
  <p>The problem is that as soon as I attempt to connect the IBDatabase component to its database, the Web method fails. I think I have ruled out all other sources for this error. I can create and populate the ClientDataset with a rather large ClientDataSet's XML sent from the client that includes nested datasets with no problems (I am using the MidasLib unit, so the ClientDataSet is not trying to load a DLL). I can create and configure, short of connecting to, the IBDatabase and its various components. Again, with no problems. As soon as I set the IBDatabase component's Connected property to True from within the Web service, it fails.</p>
  
  <p>I am running IIS 7.5 under Windows 7 64-bit Ultimate (on my development machine). I have tried granting full control rights to Everyone (as well as specifically to IIS_IUSRS) to both the specific ISAPI DLL, as well as to the entire directory in which the Web service resides. This did not solve the problem.</p>
  
  <p>I suspect that this is entirely a privileges issue with IIS 7. What can I do to permit my ISAPI Web service to connect to the InterBase client API so that I can use the Web service to write to my database server?
  ' ' ' ' ' ' ' ' ' ' '<br>
  Post Script: It appears that connecting to Interbase from the Web service is not the problem. I am still tracking down the precise cause, but I have now been able to successfully connect to Interbase from within the Web service. I'll update this post once I know the cause, but this question is no longer valid.
  ' ' ' ' ' '<br>
  I am marking Bob's answer as the correct one. The connection string was wrong. Actually (and this is embarrasing, but I'd rather be embarrassed than misleading), I got bit by a <em>with</em> clause.</p>
  
  <p>I stored my connection information in resource strings. I made the assignment in a <em>with</em> clause. The name of the resource string for the DatabaseName property was DatabaseName. The <em>with</em> clause caused the DatabaseName property to be assigned to itself, instead of the value in the resource string. I fixed the problem by prefacing the DatabaseName resource string with the unit name (ie, DatabaseName := IBModUnit.DatabaseName;).</p>