sql chech if file exists (1 Viewer)

alexsams

New member
Local time
Today, 01:29
Joined
Aug 9, 2018
Messages
1
Hi,

Is there any ability to check if file exists using sql?
(the path to file builds form fields like brand, product etc. )

I know I can use VBA with dir()
But I need to aggregate that results( % of existing files by diff categories).

So I need to add it in my query...

Or maybe the way to use VBA in sql.
Or.. I created form as spreadsheet, and added there field with calculated values depending on existing of file, but I didn't find the way to use this spreadsheet in query...

Thanks in advance!:)
 

plog

Banishment Pending
Local time
Today, 03:29
Joined
May 11, 2011
Messages
11,613
You can use VBA functions from SQL, so, technically the answer is yes. But you cannot do it solely with SQL, so practically, no.

You would create your VBA function and have it take a file path. Then in the query you use it by passing it a file path:

Code:
SELECT FilePath, FilePathExists(FilePath) AS PathExists
FROM YourTable;

The function FilePathExists() is written in VBA, would do the test and return a True/False.
 

Users who are viewing this thread

Top Bottom