title: Connecting to SQL Server 2005 via web service
body: <p>Delphi 2010, dbExpress, and SQL Server 2005 DB</p>
  
  <p>I am trying to make a connection to a SQL Server 2005 DB using Delphi 2010 &amp; DBExpress.</p>
  
  <p>If I create a standard delphi application and hard code my connection (IT WORKS!):</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
  var
   Conn: TSQLConnection;
  begin
   Conn:= TSQLConnection.Create(nil);
   Conn.ConnectionName:= 'VPUCDS_VPN_SE01';
   Conn.LoadParamsOnConnect := True;
   Conn.LoginPrompt:=True;
   try
     Conn.Connected:= True;
     if Conn.Connected then
     ShowMessage('Connected!')
     else
     ShowMessage('NOT Connected!')
   finally
    Conn.Free;
   end;
  end;
  </code></pre>
  
  <p>All the ini files, and DLLs reside in the same folder as my executable</p>
  
  <p>and yes, I have DBXMsSQL &amp; MidasLib in the uses clause</p>
  
  <p>again, it works if its not a web service!</p>
  
  <p>However, if i then move the code over to a Web services CGI module:</p>
  
  <pre><code>function TTest.ConnectToDB: Boolean;stdcall;
  var
   Conn: TSQLConnection;
  begin
   Conn:= TSQLConnection.Create(nil);
   Conn.ConnectionName:= 'VPUCDS_VPN_SE01';  
   Conn.LoadParamsOnConnect := True;
   Conn.LoginPrompt:=True;
   try
     Conn.Connected:= True;
     result:=  Conn.Connected;
   finally
    Conn.Free;
   end;
  end;
  </code></pre>
  
  <p>Thanks</p>