Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-24-2004, 01:33 PM
murphys murphys is offline
Senior Member
 
Join Date: Aug 2001
Posts: 2,948
Default remote sql server DB

i want to write an application which reads data from a sql DB which resides on a remote site: http://www.blah.com/db

how is it possible to do it using ADO components?
what settings should be set on the server side/db side in order to achieve it?

10x
Amos
Reply With Quote
  #2  
Old 10-24-2004, 01:58 PM
murphys murphys is offline
Senior Member
 
Join Date: Aug 2001
Posts: 2,948
Default RE: remote sql server DB

i read some posts here and saw that i need to install MySQL driver on my computer, even though im talking about sql server?

do i need to install these drivers on all the clients ?

10x
Amos
Reply With Quote
  #3  
Old 10-25-2004, 10:46 AM
Rob-Z Rob-Z is offline
Senior Member
 
Join Date: Jul 2003
Posts: 134
Default RE: remote sql server DB

Use ADO Connections and ADO Components. ADO is available in Delphi. ADO stands for ActiveX Data Objects and is automatically installed with Microsoft IIS so you don't need any server side installs or microsoft client side installs to make it work. It is basically a programming interface to access data in a database. The steps for ADO typically are:

1. Create an ADO connection to a database
2. Open the database connection
3. Create, update, delete records with ADOQuery or ADOTable
4. Close the connection.

PLEASE CLICK Accept as Answer IF HELPFUL



Rob
Reply With Quote
  #4  
Old 10-25-2004, 12:13 PM
Rob-Z Rob-Z is offline
Senior Member
 
Join Date: Jul 2003
Posts: 134
Default RE: remote sql server DB

I re-read your question. I guess my previous reply is not very helpful since you mentioned that you want to use ADO. (missed that!!!)

You can build the ADO connection string from an INI file or registry ...etc or also at runtime like this:

Code:
procedure TForm1.BitBtn1Click(Sender: TObject);
var
  MyConnectionString:WideString;
Begin
  MyConnectionString := AdoConnection1.ConnectionString;
  MyConnectionString := PromptDataSource(Form1.Handle, cs);
end;
PLEASE CLICK Accept as Answer IF HELPFUL


Rob
Reply With Quote
  #5  
Old 10-25-2004, 12:19 PM
Rob-Z Rob-Z is offline
Senior Member
 
Join Date: Jul 2003
Posts: 134
Default RE: remote sql server DB

(sorry for the different replies, I'm quick at hitting "Post Reply"). All you need to know is the server name and database name if you are using MS SQL Server and ADO. Of course provided that the server name can be resolved on the network. For example if your server name was SQLDBSERVER_1 and the database name on that server is MYDATABASE then your ADO Connection String would be:

Code:
Provider=SQLOLEDB.1;Password=defaultpassword(if any);Persist Security Info=True;User ID=defaultuserid(if any);Initial Catalog=MYDATABASE;Data Source=SQLSERVER_1
What you can do is double click on the ADOConnection component and build the connection, then click TEST CONNECTION. You can change any parameters on the ADOConnection string within your program.

PLEASE CLICK Accept as Answer IF HELPFUL

Rob
Reply With Quote
  #6  
Old 10-25-2004, 11:08 PM
murphys murphys is offline
Senior Member
 
Join Date: Aug 2001
Posts: 2,948
Default RE: remote sql server DB

10x for your answers.

i know how to build and do ConnectionString.
my problem is, that the "server" in which the db sits on is actually a URL.
can my "data source" be ";data source=www.blah.com/db;" ?

10x
Amos
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:31 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.