VB Connection String with MS Access - By using MAC address instead of IP Address
-
Hi All, I am developing one application with VB 6.0 and MS Access. I am using the following connection string to connect to database. Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\9.124.124.90\sanramal1\overtime log\Overtime Log\Data\OT_Log.mdb" In the above I have given the IP address of the system where the database OT_Log.mdb is located. But I am facing problem that is, Since the IPAddress is dynamic I cannot give the IP address , so I thought of using the MAC Address of the System ( Which is static even the IP address is changed). (Mac Address - Physical Address). But I dont have any idea how to give the MAC address in the connection string instead of IPAddess. Or is there any code to recover ip address by giving the mac address. Please Please help me. Thanks you all in advance, Regards
-
Hi All, I am developing one application with VB 6.0 and MS Access. I am using the following connection string to connect to database. Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\9.124.124.90\sanramal1\overtime log\Overtime Log\Data\OT_Log.mdb" In the above I have given the IP address of the system where the database OT_Log.mdb is located. But I am facing problem that is, Since the IPAddress is dynamic I cannot give the IP address , so I thought of using the MAC Address of the System ( Which is static even the IP address is changed). (Mac Address - Physical Address). But I dont have any idea how to give the MAC address in the connection string instead of IPAddess. Or is there any code to recover ip address by giving the mac address. Please Please help me. Thanks you all in advance, Regards
I would suggest looking into something like DynDNS and using that
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I would suggest looking into something like DynDNS and using that
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Please read the article I link to in my sig.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Hi All, I am developing one application with VB 6.0 and MS Access. I am using the following connection string to connect to database. Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\9.124.124.90\sanramal1\overtime log\Overtime Log\Data\OT_Log.mdb" In the above I have given the IP address of the system where the database OT_Log.mdb is located. But I am facing problem that is, Since the IPAddress is dynamic I cannot give the IP address , so I thought of using the MAC Address of the System ( Which is static even the IP address is changed). (Mac Address - Physical Address). But I dont have any idea how to give the MAC address in the connection string instead of IPAddess. Or is there any code to recover ip address by giving the mac address. Please Please help me. Thanks you all in advance, Regards
Can you not use the computer name rather than its IP Address? e.g.
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\**MyDataServer**\sanramal1\overtime log\Overtime Log\Data\OT_Log.mdb"
Steve Jowett ------------------------- It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
-
Can you not use the computer name rather than its IP Address? e.g.
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\**MyDataServer**\sanramal1\overtime log\Overtime Log\Data\OT_Log.mdb"
Steve Jowett ------------------------- It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
Hi, Thanks lot. Yes I tried by giving the computer name. But the problem is, when i install it in other's system, in some of the system it is connecting and working fine, but in some system it is not connecting with the system name that I have given in connecting string. It is because those users are in different subnet in network. So who are all in same subnet of the server (That is the system given in connecting string) they can able to connect to the application and work well. Can you please give me some ideas to overcome this problem. It is really very very urgent. Thanks lot. Regards,
-
Hi, Thanks lot. Yes I tried by giving the computer name. But the problem is, when i install it in other's system, in some of the system it is connecting and working fine, but in some system it is not connecting with the system name that I have given in connecting string. It is because those users are in different subnet in network. So who are all in same subnet of the server (That is the system given in connecting string) they can able to connect to the application and work well. Can you please give me some ideas to overcome this problem. It is really very very urgent. Thanks lot. Regards,
This question was asked and answered before. You have a DNS configuration issue on your network. Only your LAN Admin can fix this problem so that all the machines on the network can resolve the name of the server to it's IP address. This is your ONLY possible solution! You can NOT use the MAC address in the connection string. The MAC address isn't usable by your code at all. It's a physical layer address used to transmit packets between network cards on the same physical subnet. The MAC is completely meaningless to your application.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008