SHOTOKANKATANA
New member
- Local time
- Today, 20:03
- Joined
- Dec 4, 2021
- Messages
- 17
Hi,
Hopefully I'm not posting a question already asked.
I have trouble finding a solution...
I have an access DB that writes reports to my desktop.
It also writes reports to the lan server but I have to sign into this server from windows explorer before the code works.
It throws a managed error if the connection has not yet been established, which makes total sense
When I boot my pc and connect to the network server through windows explorer like so: \\192.x.x.x before using the form control to create and store reports everything works fine and as expected. For as long as the pc stays powered on I can keep using the report creation/storing button just fine. After a reboot though I have to connect to the server through the explorer again first to prevent the error.
I understand why it acts like this, without the server connection the coded path's don't yet exist so it can't reach the location...
What I like to do is just work from the DB without signing in through windows explorer first.
I tried many things in code that all work but only if the connection is already established through windows explorer.
Is there a vba way to pop up windows explorer asking for username and password to connect to the server if the report button is used while the connection is not yet established through explorer? If possible I would prefer to do this without mapping the network drive. I have code in place to test if the server has an active connection with the pc but I can't figure out how to establish the connection by signing in with my username and password like I would do through windows explorer if the connection was not yet created, for example after booting the computer...
Hope this makes sense... English is not my native language...
Thanks in advance for any pointers in the right direction!
Hopefully I'm not posting a question already asked.
I have trouble finding a solution...
I have an access DB that writes reports to my desktop.
It also writes reports to the lan server but I have to sign into this server from windows explorer before the code works.
It throws a managed error if the connection has not yet been established, which makes total sense
When I boot my pc and connect to the network server through windows explorer like so: \\192.x.x.x before using the form control to create and store reports everything works fine and as expected. For as long as the pc stays powered on I can keep using the report creation/storing button just fine. After a reboot though I have to connect to the server through the explorer again first to prevent the error.
I understand why it acts like this, without the server connection the coded path's don't yet exist so it can't reach the location...
What I like to do is just work from the DB without signing in through windows explorer first.
I tried many things in code that all work but only if the connection is already established through windows explorer.
Is there a vba way to pop up windows explorer asking for username and password to connect to the server if the report button is used while the connection is not yet established through explorer? If possible I would prefer to do this without mapping the network drive. I have code in place to test if the server has an active connection with the pc but I can't figure out how to establish the connection by signing in with my username and password like I would do through windows explorer if the connection was not yet created, for example after booting the computer...
Hope this makes sense... English is not my native language...
Thanks in advance for any pointers in the right direction!