Put it in a query component and the query will return the server name result.
select @@servername --> returns the server name on your comptuer
sun4sunday
Main Topics
Browse All TopicsI have a server on my ssytem and need at runtime to get the server name to can assign it to a connection.
How to do that?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
My solution will give only after connecting to the database server.
If you just need the servername you can follow for the testing purpose.
Place a query componet and set the connection etc (i think you are looking the server name at run time)
Place the floowing query int he SQL
select @@servername as svrname
Place a grid and connect this query component .
Mkae Active the query component.
You can see the reuslt there.
>>need at runtime to get the server name
This will give the server name at runtime.Here still you should know the servername to make a connection for the query.
sun4sunday
I don't have any sql server instaled to test, but doesn't the demo from here http://delphi.about.com/od
I think ciuly solution http://delphi.about.com/od
If you already have a connection and just to know the server name, my solution will work.
or are u looking for something else ?
sun4sunday
>>I have a server on my ssytem and need at runtime to get the server name to can assign it to a connection.
To reach the server you need a connection and should know the servername.
If you don't know the server name, you are shooting in the dark.
Also there can be multiple instances of the server possible.
sun4sunday
Business Accounts
Answer for Membership
by: ciulyPosted on 2006-08-24 at 13:33:59ID: 17384636
check these out: /threads/t hread.cfm? ID=165815& G=165815 /sqlserver msdeaccess /l/ aa09070 4a.htm
http://www.delphipages.com
http://delphi.about.com/od