You could only do it in an installation script of some kind, since dynamically calling database functions, when they're not compiled in, will stop execution of the script and since in an installation script, you can always ask the installer, I fail to see the point - but:
you could of course open sockets to the specified host on the default port a database server listens on. This will fail with MS Access, since it isn't a server, and it will fail, when people change ports as a security by obscurity rule.
The alternative would be to rely on ODBC and the like, and use a very thin set of SQL commands, which will work with all databases.