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 + ';'
Buropro-CitationAsked:
Who is Participating?
 
kenwagersConnect With a Mentor Commented:
Do you get the same error if you attempt to connect / test in another method?  Try creating a .udl connect with the same info.

Name the file test.udl, and it should contain:
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;User ID=sa;Password = password; Data Source=server;Persist Security Info=False


Then when you double click on the file, it will allow you to test the connectioh
0
 
kenwagersCommented:
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?
0
 
kenwagersCommented:
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"
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
Buropro-CitationAuthor Commented:
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.
0
 
GhitzaConnect With a Mentor Commented:
Also check the router for port forwarding on the location of the server...
make a test application with only the connectionString editable. Something like a form, a memo (with sonnection string( and a button that adds connection string to the database component from the memo. Also chek out hat the server does not use an instance.
Do not forget to use a connection string from http://www.connectionstrings.com/
0
 
CodedKConnect With a Mentor Commented:
Hi Informatique-hamel,
Check my PAQ here:

www.experts-exchange.com/Programming/Pascal/Q_25716743.html

I explain how to connect to remote SQL Server.

Hope this helps.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.