Link to home
Start Free TrialLog in
Avatar of muldeyur
muldeyur

asked on

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
Avatar of manjushan
manjushan

Use ado connection.Build the connection string.Use ADO tables and ADO queries.
   Good luck.
               Manju.
Avatar of muldeyur

ASKER

Thankx ManjusHan,

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

Cheers,

Yuri
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.
                           
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?
ASKER CERTIFIED SOLUTION
Avatar of manjushan
manjushan

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
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