disgracept
Member
- Local time
- Today, 15:45
- Joined
- Jan 27, 2020
- Messages
- 45
Hi guys,
I'm going to deploy a DB frontend to users that connects to a backend DB where the tables reside.
Since the backend will be in a shared file server folder, i need to check if the connection is possible (the server may be down for example) every time the frontend is launched.
The path for the backend will be, of course, lengthy and, probably, will contain spaces...
So i'm trying to make a connection to the backend using ADO to check if it's all ok, with this code that i found after researching online:
But when i try to run it, it gives me this error:
My references are these:
Can't figure out why and my online search gave no results...
Can anyone help me please?
Thanks in advance.
I'm going to deploy a DB frontend to users that connects to a backend DB where the tables reside.
Since the backend will be in a shared file server folder, i need to check if the connection is possible (the server may be down for example) every time the frontend is launched.
The path for the backend will be, of course, lengthy and, probably, will contain spaces...
So i'm trying to make a connection to the backend using ADO to check if it's all ok, with this code that i found after researching online:
Code:
Dim cnnConnection As ADODB.Connection
Set cnnConnection = New ADODB.Connection
With cnnConnection
.CursorLocation = adUseServer
.Open "PProvider=Microsoft.Jet.OLEDB.4.0;" & "Data Source='C:\Users\Carlos Revés\OneDrive\Ambiente de Trabalho\ImóveisDH_be.accdb'"
End With
But when i try to run it, it gives me this error:
Error: -2147467259. [Microsoft][ODBC Driver Manager] Data source name too long
My references are these:
Can't figure out why and my online search gave no results...
Can anyone help me please?
Thanks in advance.