# How to connect MS Access database to server project

**URL:** https://forum.cloverdx.com/t/how-to-connect-ms-access-database-to-server-project/2145
**Category:** CloverDX Platform
**Created:** [August 25, 2023, 11:46am UTC](https://forum.cloverdx.com/t/how-to-connect-ms-access-database-to-server-project/2145 "2023-08-25T11:46:22Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Peter\_Garbar](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@Peter\_Garbar](https://forum.cloverdx.com/u/Peter_Garbar)
#### Post date: [August 25, 2023, 11:46am UTC](https://forum.cloverdx.com/t/how-to-connect-ms-access-database-to-server-project/2145/1 "2023-08-25T11:46:22Z")

</div>

Hello,

I converted my local project which uses ms access as source database connection(mdb file) to server project. How should be the jdbc path written, so the server can find the access database in data-in folder of the project?

---

<div class="post-metadata">

### Author: ![David\_Pavlis1](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/david_pavlis1/32/67_2.png) [@David\_Pavlis1](https://forum.cloverdx.com/u/David_Pavlis1)
#### Post date: [September 5, 2023, 8:33am UTC](https://forum.cloverdx.com/t/how-to-connect-ms-access-database-to-server-project/2145/2 "2023-09-05T08:33:18Z")

</div>

Hi Peter,

It seems that the JDBC driver used for accessing MS Access needs an absolute path (means ${DATAIN\_DIR} won’t work as it is a relative path). You can still use a Clover parameter, but it has to contain an absolute path to your database file (the reason being that file access in this case is not managed by Clover, but the JDBC driver directly).

---

<div class="post-metadata">

### Author: ![Tomas\_Pavlas](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/tomas_pavlas/32/170_2.png) [@Tomas\_Pavlas](https://forum.cloverdx.com/u/Tomas_Pavlas)
#### Post date: [September 6, 2023, 12:15pm UTC](https://forum.cloverdx.com/t/how-to-connect-ms-access-database-to-server-project/2145/3 "2023-09-06T12:15:25Z")

</div>

Hello,

Let me, please, add some information to this matter.

The easiest way to achieve the above described approach is to use the _[toAbsolutePath](https://doc.cloverdx.com/latest/designer/miscellaneous-functions-ctl2.html#id%5Fctl2%5Ftoabsolutepath)_ function in the definition of a _dynamic parameter_ which can be then pasted into the JDBC URL for MS Access.

To utilize this function in the CloverDX Designer, please, do as follows:

1. Create a parameter and in the […] menu, click on the _Convert to dynamic_  
 ![](https://canada1.discourse-cdn.com/flex007/uploads/cloverdx1/original/1X/abef8c3392c14f236918b5c1aecf97716ad482ec.jpeg)
2. The _Value definition_ window will open. To define the Absolute path to the .mdb file from the data-in folder we insert one line of CTL code to prepared function.  
**function**  **string**  **getValue** () {  
**return**  **toAbsolutePath** ( **getParamValue** (“DATAIN\_DIR”));  
}  
First resolve the _data-in_ folder URL inside the project, for that use _[getParamValue](https://doc.cloverdx.com/latest/designer/miscellaneous-functions-ctl2.html#id%5Fctl2%5Fgetparamvalue)_, because the URL is in the default parameter called _DATAIN\_DIR_. ![](https://canada1.discourse-cdn.com/flex007/uploads/cloverdx1/original/1X/c388cc492044944dbcd8646ab8e0a0cf774743a5.jpeg)Then wrap that piece of code into the _toAbsolutePath_ function as mentioned earlier.
3. Now we can use the ABS\_PATH\_DATAIN parameter in the JDBC URL.  
 ![](https://canada1.discourse-cdn.com/flex007/uploads/cloverdx1/original/1X/49fad1ec4fb0c28500ce72766f7f1fb4d32cf27b.jpeg)

And all should be good to go.

Note:  
**_Validate connection_** _button in the CloverDX Server environment will fail because the dynamic parameter will validate locally. In runtime the parameter will work properly._

---

<div class="post-metadata">

### Author: ![Peter\_Garbar](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@Peter\_Garbar](https://forum.cloverdx.com/u/Peter_Garbar)
#### Post date: [September 6, 2023, 12:33pm UTC](https://forum.cloverdx.com/t/how-to-connect-ms-access-database-to-server-project/2145/4 "2023-09-06T12:33:02Z")

</div>

Thanks a lot. Problem with this is, I cannot generate metadata from designer. So after I found out the absolute server path, I used this hardcoded. Next problem I get is, the designer tries to pass admin as username even I specify no username. I will try with empty string as parameter and see if it works. Or do you perhaps have some other idea about the username? When using local mdb file, no problem with username.

---

<div class="post-metadata">

### Author: ![Tomas\_Pavlas](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/tomas_pavlas/32/170_2.png) [@Tomas\_Pavlas](https://forum.cloverdx.com/u/Tomas_Pavlas)
#### Post date: [September 8, 2023, 7:43am UTC](https://forum.cloverdx.com/t/how-to-connect-ms-access-database-to-server-project/2145/5 "2023-09-08T07:43:47Z")

</div>

Hi Peter,

I tried to replicate your situation and I was unsuccessful. I created the MS Access connection to the password-protected .mdb file. If the password is correct, everything works, despite the **Username** field being empty or filled with a random string.

So, to find out more about this issue, could you please provide some information about the situation?

1. Execution Log from the graph, mainly the part with the connector.
2. Screenshot of the connection, and how it is created.
3. Screenshot of the graph in Designer so we know what components you are using and can try to replicate it.

Ideally, you could provide that information for both CloverDX Server and CloverDX Designer environments. So, we could figure out, what are the differences in execution on both sides.

Ideally, run your graph both within a local and a server project and provide the above-listed pieces of information for both. So, we could figure out, what the differences in executions on both sides are.

Thank you in advance, Tom.

---

<div class="post-metadata">

### Author: ![Peter\_Garbar](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@Peter\_Garbar](https://forum.cloverdx.com/u/Peter_Garbar)
#### Post date: [September 8, 2023, 9:57am UTC](https://forum.cloverdx.com/t/how-to-connect-ms-access-database-to-server-project/2145/6 "2023-09-08T09:57:40Z")

</div>

I should have mentioned that I do not have password protected mdb file. Username and password are empty.

---

<div class="post-metadata">

### Author: ![Tomas\_Pavlas](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/tomas_pavlas/32/170_2.png) [@Tomas\_Pavlas](https://forum.cloverdx.com/u/Tomas_Pavlas)
#### Post date: [September 15, 2023, 11:42am UTC](https://forum.cloverdx.com/t/how-to-connect-ms-access-database-to-server-project/2145/7 "2023-09-15T11:42:37Z")

</div>

Hi Peter,

this scenario was also tested and worked properly in our environment. Moreover, it shouldn’t have any effect on the fact that you are experiencing different behavior on a Local project and a CloverDX Server project. In that case, could you, please, provide the information requested above, so we can look closely at the issue?

Best regards, Tom.
