• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

Connecting to a remote SQL DB

Hi,

 I need to connect to a remote SQLserver outside my local network. The Server is on the Internet. i played arround with the Midware Package but didn't succeed.

I'am looking for some pointers or idea's to create the connection, it has to be very stable and secure.

Hope somebody has done this before and is willing to help.

Regards,

Yuri
0
muldeyur
Asked:
muldeyur
  • 4
  • 2
1 Solution
 
manjushanCommented:
Use ado connection.Build the connection string.Use ADO tables and ADO queries.
   Good luck.
               Manju.
0
 
muldeyurAuthor Commented:
Thankx ManjusHan,

Do you have a Code example?
I alway's worked with Odbc.

Cheers,

Yuri
0
 
manjushanCommented:
ADO-Active data objects also use ODBC.If ur using Delphi 5 u will have ADO components. ADO Connection is availabe through which u can build ur connection string. If ur using > Delphi 5.Then use ADODB_TLB. U have a _connection class.
 Set the connection string something like this
  ConnectionString := 'mydatabase'
  Connection.Open(ConnectionString,username,password)

for SQLServer it will look like his
   Connectionstring := 'Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=mydata'

U have a connection.Then use _RecordSet to open tables.For detailed info search for ADO in any Delphi site.
                 Good luck.
                   Manju.
                           
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
muldeyurAuthor Commented:
Thankx, i'am using delphi4,
but i can usethe Ado typlib. Would it be possible to set up a dsn to a remote sql server?
0
 
manjushanCommented:
Sure u can connect to a remote server using Ado typ lib.
User connection string will look like this

ConnectionString := "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=MyDatabase;SERVER=164.164.64.25;UID=sa;WSID=MANJU;DATABASE=ProductCenter;Address=164.164.64.25,1433"

Systemname - MANJU
DatabaseName - ProductCenter
Alias/Source - MyDatabase
Addressofthe remote machine-164.164.64.25
Port-1443
                   
                                Good luck
                                    Manju
                 
0
 
manjushanCommented:
Sure u can connect to a remote server using Ado typ lib.
User connection string will look like this

ConnectionString := "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=MyDatabase;SERVER=164.164.64.25;UID=sa;WSID=MANJU;DATABASE=ProductCenter;Address=164.164.64.25,1433"

Systemname - MANJU
DatabaseName - ProductCenter
Alias/Source - MyDatabase
Addressofthe remote machine-164.164.64.25
Port-1443
                   
                                Good luck
                                    Manju
                 
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now