SqlUtilEnumerateDatabases - cDbUpdateFunctionLibrary
Enumerates SQL databases for the passed driver ID.
Type: Function
Parameters: String sDriverID
Parameter |
Description |
sDriverID |
MSSQLDRV_ID, DB2_DRV_ID, ODBC_DRV_ID, ORAFLEX, SQLFLEX, MDSPgSQL or MDSMySQL |
Syntax
Function SQLUtilEnumerateDatabases String sDriverID Returns String[]
Call: |
Get SQLUtilEnumerateDatabases MSSQLDRV_ID to sMyDatabaseArray |
Description
Use it to retrieve all SQL databases on a machine. The return value is a string array.
Example
Procedure Activating
tDataSourceRow[] MyData
Handle hoDataSource
String[] sValueArray
String sDriverID
Integer iCount iSize
Send Cursor_Wait of Cursor_Control
Forward Send Activating
Get psDriverID to sDriverID
Send Ignore_Error of Error_Object_Id DFERR_CANT_LOAD_DLL
Load_Driver sDriverID
Send Trap_Error of Error_Object_Id DFERR_CANT_LOAD_DLL
If (LastErr = 4255) Begin
Send Info_Box ("Can't display any items because the database driver could not be loaded. (" + sDriverID + ")")
Procedure_Return
End
Get SqlUtilEnumerateDatabases of ghoDbUpdateFunctionLibrary sDriverID to sValueArray
Move (SizeOfArray(sValueArray)) to iSize
Decrement iSize
For iCount from 0 to iSize
Move sValueArray[iCount] to MyData[iCount].sValue[0]
Loop
Get phoDataSource to hoDataSource
Send InitializeData of hoDataSource MyData
Send Cursor_Ready of Cursor_Control
End_Procedure