We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,555 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Auto Detect IP Address

Hello!

I have a remote database that will be accessed through a client program.
The thing is, I want the client to auto detect the IP Address of the machine
where the database is located, so that when I initialize the value of my
connection string it would be like this:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\AutoDetectedIpAddress\folder\myDatabase.mdb;User Id=admin;Password=;

In that way, the client program will automatically connect to the
remote database whatever the IP Address of the machine where the
remote database is. I don't have any clue to do this so, I'm
asking for your help guys.

Thanks in advance!

3
Contributors
4
Replies
3 Days
Discussion Span
1 Year Ago
Last Updated
5
Views
Question
Answered
ryklon
Newbie Poster
24 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I suggest you reconsider connecting via the IP address. Let the infrastructure take care of name/address translation for you and just connect using the server name. Using the IP address could impact database access in a system where clustering/mirroring provides high availability.

Reverend Jim
Illigitimae non carborundum
Moderator
3,737 posts since Aug 2010
Reputation Points: 585
Solved Threads: 469
Skill Endorsements: 33

Thanks for the reply!

Ok. I'll take your advice. But is there any chance that I can do some kind of auto detect feature? If there is none, then I'd be fine with manually doing the connection.

ryklon
Newbie Poster
24 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

If this is over LAN or WAN (VPN or leased line), then you can just use the computername. Your DNS or WINS will take care of the name resolution to the IP.

If you plan to connect over the internet then perhaps you've got to search services like dynDNS or something similar (google for free dynamic dns).
Some DSL routers support dynamic dns and you can have a hostname with a dynamic IP with no software.
BUT, be warned the type of access you are looking for in your "server" machine (sharing your actual file) shouldn't be done over the internet without a VPN (and because of this you don't need dynDNS).

adam_k
Veteran Poster
1,057 posts since Jun 2011
Reputation Points: 274
Solved Threads: 205
Skill Endorsements: 11

Thank you guys for your explanations!

I'll follow what you've suggested.

ryklon
Newbie Poster
24 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 1 Year Ago by Reverend Jim and adam_k

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0702 seconds using 2.67MB