Access database functions in external script

Hi
Using V2025 i have a external file how do i include database functions to use within it and also extract the database username and password?

thanks

This should help (see the third post): How to Load Data from Database into Custom Files (v2025)