?
Solved

Connecting to Remote MSSQL6.5 Server

Posted on 1998-10-19
6
Medium Priority
?
179 Views
Last Modified: 2012-05-04
Whats the easiest way to connect to a Microsoft SQL 6.5 Server across a TCP/IP network using Delphi 4 Client Server?
0
Comment
Question by:Dazza051197
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:dwwang
ID: 1343376
Just setup SQL server client using TCP/IP, and then create a BDE alias pointing to the TCP/IP connection, that's all.

Need some further information, please add your comment.
0
 
LVL 1

Author Comment

by:Dazza051197
ID: 1343377
Err, so I would need SQL Server Client installed, and then BDE, and then my application ?  An example of how I create the BDE alias to point to the TCP/IP connection would be a lot of help. I understand you may find this a little tedious, so I'll double the points for you if you can manage it.
0
 
LVL 1

Expert Comment

by:Greedy
ID: 1343378
well lets just get your development machine talking to it first...then we'll work on building the install for distribution.  Ok you have the C/S version that's good we will be using SQL Links instead of crummy ODBC...(has it's place but not in a Delphi C/S app)...this will out line a super quick example to show you how to do this - I'm actually doing it in D3 C/S but it hasn't changed in D4

open delphi
go to file | new application
drop a TDataBase Component on the form
drop a TTable on the form
drop a TDataSource on the form
Double click the TDataBase component
For name put in MyTestDB (this is your alias by the way - unless you have defined one in the DBE...but I don't recomend that)
leave alias name blank
for driver name use MSSQL all caps don't get confused by the SQL server one that's really ODBC
hit the button marked defaults - if you see anything in there that says ODBC you have the wrong driver
for database name type in pubs
for the server name put your server
check the login prompt and the keep connected to ON
click OK
in the object inspector click the Connected to true it'll pop up a login box...put in your user name and password...now you need to make sure that you have access to the pubs database on the SQL server if you don't go into the enterprize manager and give it to yourself...or log in as sa
Go to the TDataBase comp
in the object inspector set the database name to MyTestBD...it'll be in the list
then for table name put in jobs (dbo.jobs)
then click on the datasource and set the dataset to table1
click on the grid and set it datasource to datasource1
then click on the table and set active to true...the grid should display something...it might not have any data in it but you get the idea...

You can also use a TQuery to do this too...it's as easy and gives beter performance...(in most cases anyway)




0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Accepted Solution

by:
dwwang earned 1200 total points
ID: 1343379
No you don't need do these manually, InstallShield can do all for you, since currently we are just distributing our softwares in this way:

1.collect DLLs needed by SQL Client(and let IS to install them to windows's system directory or your App's dir)
2.add registry entry needed by TCP/IP SQL Client
3. Also IS can help you install the BDE

I'will paste all the details within an hour.
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1343380
Hi, here is the detail:

1. the DLL's needed by SQL Server6.5 Client:
DBMSPCN.DLL
DBMSSOCN.DLL
DBMSSPXN.DLL
DBNMPNTW.DLL
NTWDBLIB.DLL
Let InstallShield to copy them to the proper directory.

2. Registry info needed: (let IS add them for you)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo
Add an string entry of your preferred ServerName (Its name can be any string, for example:MySQLServer)

Set the value to :  "DBMSSOCN,172.16.1.1,1433"
(172.16.1.1 should be replaced by you SQL Server's TCP/IP, and 1433 should be replaced by its port, but 1433 is the default)

3. In the BDE Alias section Step 3 of IS, simply add two lines in the editbox:

DATABASE NAME=YouDBNameInSQLServer
SERVER NAME=YouPreferredServerName (which is the entry name in the registry info)

That's all, depends on that you know how to use InstallSiheld.


0
 
LVL 1

Author Comment

by:Dazza051197
ID: 1343381
I'd like to split the points between Greedy and Dwwang.  Greedy's excellent detailed explanation of how to connect to the SQL database was perfect and Dwwang's list of the DLL's I need.  I've now connected to my first MS SQL Server via TCP and I thank you very much.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month8 days, 5 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question