oDLink = CreateObject("Datalinks") >oDLink.PromptNew()>If you are able to test the connection succesfully you can get the return value from the function and it will be an ADO connection object. I have another download here that does this. It's called something like "Get parameters collection".
*!* Module: EnumOLEDBProviders.PRG *!* Description: Creates an array containing the names of all installed *!* OLE DB Providers *!* Parameters: taProviders - a variable passed by reference *!* Returns: taProviders, changed into an array and populated with provider names *!* Sample Call: *!* gaOLEDBProviders = "" *!* ?EnumOLEDBProviders(@gaOLEDBProviders) *!* History: *!* 2001.12.13 - J. Crescencio Flores - Original Version *!* Universal Thread message http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~?2,15,593911 *!* 2001.12.13 - Al Doman *!* Commented the code *!* Modified variable names to be more descriptive *!* Changed ASCAN() call to be EXACT and case-insensitive #DEFINE HKEY_CLASSES_ROOT -2147483648 && BITSET(0,31) from registry.h LPARAMETERS ; taProviders LOCAL ; loReg, ; lnErr, ; lcValue, ; lnProviderCount, ; laKeys, ; laSubKeys, ; llIsProvider DIMENSION ; taProviders[1] lnProviderCount = 0 * Create a VFP FFC Registry object: loReg = NEWOBJECT("Registry", HOME() + "FFC\Registry.VCX") * Open HKEY_CLASSES_ROOT\CLSID: loReg.OpenKey("CLSID", HKEY_CLASSES_ROOT) * Enumerate all keys of HKEY_CLASSES_ROOT\CLSID into an array: lnErr = loReg.EnumKeys(@laKeys) IF lnErr <> 0 RETURN lnErr ENDIF * Close the current key: loReg.CloseKey() * Scan each element of the array collection (i.e. all subkeys of * HKEY_CLASSES_ROOT\CLSID): FOR EACH arrElem IN laKeys laSubKeys = .F. llIsProvider = .F. * Open the collection key: lnErr = loReg.OpenKey("CLSID\" + arrElem, HKEY_CLASSES_ROOT) IF lnErr=0 * Enumerate subkeys of this key into another array: lnErr = loReg.EnumKeys(@laSubKeys) ENDIF * Close the collection key: loReg.CloseKey() IF VARTYPE(laSubKeys) <> "L" * This collection key is an OLE DB Provider if one of its * subkeys is "OLE DB Provider": llIsProvider = (ASCAN(laSubKeys, "OLE DB Provider", -1, -1, 0, 7) <> 0) ENDIF IF llIsProvider * Get the string value of this key * Conveniently, it's the name of the provider: lnErr = loReg.GetRegKey("", ; @lcValue, ; "CLSID\" + arrElem + "\OLE DB Provider", ; HKEY_CLASSES_ROOT) IF lnErr=0 * Increment the provider count only if we can get the string value: lnProviderCount = lnProviderCount + 1 IF lnProviderCount > 1 * Add a new output array element: DIMENSION taProviders[lnProviderCount] ENDIF * Write the provider name to the new output array element: taProviders[lnProviderCount] = lcValue ENDIF ENDIF ENDFOR RETURN 0