Link to home
Start Free TrialLog in
Avatar of Buropro-Citation
Buropro-CitationFlag for Canada

asked on

Connecting to online SQL server database via Delphi application

Hi everyone, I'm trying to connect to a SQL database located on my web server using my Delphi application.    Every of my customers using this application will have to be able to acces this database from their company without them having to configure something on their computers.

I'm not sure how to do this and would need an expert help on this matter, currently I'm using this connection string for local databases but it doesn't seem to work when I use IP address for the server.

ConnectString := 'Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=' + vServer + ';Initial Catalog=' + vTable + ';'
Avatar of kenwagers
kenwagers
Flag of United States of America image

Have you checked firewalls on both sides to ensure the SQL traffic can be passed through?  It should work, but most web servers have blocked all traffic except specified ports.

In the above statement, 'vTable' should be the Database name, not the table name, correct?
One follow up - you will probably not be able to use Integrated security, as your users would not likely have local windows or domain accounts on your web server.  You'll need to use individual user names & passwords.

 DataConnection = "Provider=SQLOLEDB.1;Initial Catalog=;Data Source=;UID=;PWD=;Connect Timeout=15"
Avatar of Buropro-Citation

ASKER

Removing the SSPI helped, I'm now able to see a log event in the sql server management studio.   Problem I'm now getting an error, I'm using UID=SA;PWD=SA; but I'm getting a 18456 error (gravity 14, state 8) which is clearly a password error even though SA is the right password.
ASKER CERTIFIED SOLUTION
Avatar of kenwagers
kenwagers
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of CodedK
CodedK
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial