Connecting to SQL Server Database Through Web Service

1.) I can create a simple application that has one subroutine called

function ConnectToDB: Boolean

      

and run it from my virtual directory (wwwroot / cgi-bin) and it will connect and report connecting.

2.) I can create a simple helloWorld web service

function helloWorld: String;stdcall;

      

I can create a client and call my web service call "helloWorld" and get my "HELLO WORLD" string returned to me - everything works fine.

3.) NOW if I take the connection code from the first step (1) and put it into a web service, I cannot connect to the DB. It always returns false.

Note. I am using Delphi 7 to build my web service. I am using DBXpress as a pipe to MS SQL Server DB, and two INI files (dbxconnections.ini, dbxdrivers.ini) and two DLLs required to connect are in the same folder as the executables (wwwroot / cgi-bin) ...

Any help would be much appreciated! Again, please remember steps 1 and 2 before answering.

Thanx!

+2


a source to share


1 answer


How does the connection connect - is it using Windows Integrated Authentication or using sql authentication - could it be that the built-in auth is not working as iis is running as a different user.



Also when you connect do you want to disable the username / password prompt?

0


a source







All Articles