Not that this has anything to do with the error you are receiving, but I think you need to start by getting your code correct(as I noted earlier in this thread). The way you are using the UDF is not right. There is a FAQ on using and creating UDFs: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=82017&page=1#Post82017

Please consider the following changes: (I could not test this so its very possible there are bugs)

break ON
$=setoption("Explicit","on")
$=setoption("NoVarsinstrings","on")
dim $test1, $server, $store


$test1="aber.nade" ; The period in this account name causes the IDispatch error


$Server=HOMEMDB($test1,"Server")
$Store=HOMEMDB($test1,"Store")
? $store
? $server


Function HOMEMDB($ADAccountName,$mode)
Dim $AdoCon
dim $AdoCommand
dim $Recordset
dim $Filter
dim $homemdb
dim $store
if len($ADAccountName)>0
$filter=" where samAccountName='"+$ADAccountName+"' "
$AdoCon = CreateObject("ADODB.Connection")
$AdoCon.Provider = "ADsDSOObject"
; Current credentials are used, as username and password aren't specified
$AdoCon.Open("Active Directory Provider")
; Create ADO command object for the connection.
$AdoCommand = CreateObject("ADODB.Command")
$AdoCommand.ActiveConnection = $AdoCon
$AdoCommand.CommandText ="Select homemdb from 'LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")+"' "+$filter
; Execute the query.
$Recordset = $AdoCommand.Execute
$homeMDB=split($recordset.fields("homemdb"),",") ; This gives the error
select
case $mode="Store"
$store=split($homemdb[0],"=")
$HOMEMDB=$store[1]
case $mode="Server"
$HOMEMDB=right($homemdb[3],4)
endselect
endif
Endfunction


Please read the faq and look through/test my example. If you don't understand why I did it this way then please ask.

If we can get this correct, we might be able to figure out the other problem as well.