cajadeavila Posted July 23, 2009 Share Posted July 23, 2009 Hi,im going crazy, i´ve been a week with this problem and cannot find any solution. This script should connect to an Access DB and extract the strings with the directions of the resources to connect Network Drives.The connection.open doesnt workAnyone knows why?Thank u very much expandcollapse popup#include <WinNet.au3> #include <AD.au3> #include <Array.au3> #Include <WinAPI.au3> Dim $usuario = @UserName Dim $nombredbdepart = "E:\mapeando2.mdb" Dim $nombretabla = "MAPEO" $strQuery = "<LDAP://" & $strHostServer & "/" & $strDNSDomain & ">;(sAMAccountName=" & $usuario & ");ADsPath;subtree" $objRecordSet = $objConnection.Execute ($strQuery) $ldap_entry = $objRecordSet.fields (0).value $oUsr = ObjGet($ldap_entry) $usergroups = $oUsr.GetEx ("memberof") $count = UBound($usergroups) Dim $query = "SELECT RECURSO FROM MAPEO WHERE DEPARTAMENTO = Informatica" $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open("Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & $nombredbdepart) $adoRs = $adoCon.Execute($query) MsgBox(0, "adoRs",$adoRs) $usergroups = $oUsr.GetEx ("memberof") MsgBox(0, "UserGroups",$usergroups) While Not $adoRs.EOF MsgBox(0, "MUESTRA", $adoRS) MsgBox(0, "Dentro de funcion hasta fin de linea",$usergroups) $salida = $adoRs.Fields("RECURSO").value MsgBox(0, "SALIDA",$salida) DriveMapAdd("*",$salida) $len = StringLen($salida) MsgBox(0, "Longitud de la cadena:", $len) $result = StringTrimRight($salida2, $len) MsgBox(0, "Cadena sin los caracteres:", $result) $adoRs.MoveNext WEnd $adoCon.CloseThis is the error message And this is the database Link to comment Share on other sites More sharing options...
cajadeavila Posted July 23, 2009 Author Share Posted July 23, 2009 I think the script makes the connection OK, BUT $adoRs values arent saving data okAny Idea???, Thanksss!!!! Link to comment Share on other sites More sharing options...
nuberoid Posted July 23, 2009 Share Posted July 23, 2009 (edited) Dim $query = "SELECT RECURSO FROM MAPEO WHERE DEPARTAMENTO = 'Informatica'" try this one =) Edited July 23, 2009 by nuberoid Link to comment Share on other sites More sharing options...
cajadeavila Posted July 23, 2009 Author Share Posted July 23, 2009 THANKSSSSSSS nuberoid NOW IT WORKS!!!!!!!! THANKS THANKS THANKS Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now