I got 2...

Is there no one who can assist/guide me?

Hi All,

I am trying to retrieve the telephone number from Active Directory for my script, I found alot of examples online, and I tried to implement what I think should make sense (but since I really don't know vb that well, this is problematic). Below is the piece of code:

[CODE]
.
.
.
''''Get Phone Number from Active Directory using employee ID retrieved from the logged in user

        Dim dirEntry, de As DirectoryEntry
        Dim dirSearcher As DirectorySearcher
        Dim sr As SearchResult

        dirEntry = New System.DirectoryServices.DirectoryEntry("LDAP://company.com")
        dirSearcher = New System.DirectoryServices.DirectorySearcher(dirEntry)
        dirSearcher.Filter = "(employeeID = " & Me.fp.BadgeNo & ")"

        'The PropertiesToLoad.Add method will be useful when retrieving only the selected properties.
        dirSearcher.PropertiesToLoad.Add("telephoneNumber")
        'Users Phone

        sr = dirSearcher.FindOne()

        If sr Is Nothing Then 'return false if user isn't found
            Me.tb_phone.Text = "N/A"
        End If

        'Retrieve the user's Phone Number and assigns them to text boxes
        de = sr.GetDirectoryEntry()

        If Not de.Properties("telephoneNumber").Value Is Nothing Then
            Me.tb_phone.Text = de.Properties("telephoneNumber").Value.ToString()
        End If

.
.
.
[/CODE]

After running the script, I am getting the following error: "[I]An operations error occurred[/I]" and the error always points to: "[I]sr = dirSearcher.FindOne()[/I]"

Please help

Maydhya

Oh ok, thanks for your help.

debasisdas commented: Finally for marking this thread as solved after a couple of years. :) +8

Just for those viewing, I figured it out...the snap-in was manually installed via the command prompt so this problem was fixed.

Not Solved...but I am closing this thread!

wow...no one has ever gotten this problem?!?

Hello,

I did follow through your suggestion for configuring IIS using the [URL="

Hi All,

I am new to this particular forum because I will like to start working with ASP.NET (it's required in my job) but I haven't the faintest idea anything pertaining ASP.NET. I hear things like Configuring IIS and Visual Studio...I was told that this is for a web-based application...could someone please guide me into understanding these things, the necessary requirements, the everything (I hope...)...

Anxiously awaiting your reply :S
May

I did, and that brings about an error...

Hi djbabu,

I did try $$empno in the where clause, but it still showed the same error...

Hi All,

I am working in Oracle10g and I have been trying to run the following query, and am getting an error:

[B]Query:[/B]
[CODE=sql]
SET VERIFY OFF

VARIABLE emp_salary NUMBER

ACCEPT empno PROMPT 'Please enter a valid employee number: '

SET AUTOPRINT ON

DECLARE
empno NUMBER(6):= &empno;
BEGIN
SELECT salary INTO :emp_salary FROM employees
WHERE employee_id = empno;
END;
/
[/CODE]

[B]Error:[/B]
[CODE=sql]
empno NUMBER(6):= ;
*
ERROR at line 2:
ORA-06550: line 2, column 19:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
( - + case mod new not null <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternatively-quoted S

EMP_SALARY

SQL> [/CODE]

If the error shows up distorted...the asterisk is located under the semi-colon in the error...
Could anyone guide me accordingly?

I will research on it. Thanks much...
:)

Hi Ezzarel,

I changed this part of the project from Java to PHP (which is a lot more convenient).
Thanks alot for the help though...
:)

Hi Nav33n,

I followed your advice and I got it to work. Thanks alot...
:)

I got the problem sorted out...honestly I did not do anything to it...what happened is that a technician came and installed the cd/dvd writer on the machine, I started the machine and loaded dreamweaver (like I do every morning) but dreamweaver said that it was reloading the cache...I didn't know that needed to happen!!! anyways, when I typed in the date in the format mysql has it stored (I was trying it without the calendar), it worked perfectly...so I tried using the calendar (with the date format syntax in the mysql syntax) and it didn't work....so i started hunting online for a calendar to enter the date in the format that mysql stores the date...and presto! i got 1, and now my caledar works like a charm...

Hi kkeith29,

Thanks so much, it works now...I did try using the [B]&&[/B], but not [B]!==[/B], and since that didn't work, I posted it here...thanks again...:)

May

Hi All,

Could you help/guide me accordingly please...My intentions with this piece of code is for the relevant image to display with the respective user...my problem is that it doesn't work for the second user type (SysAdmin), it only works for 'Admin'...

[CODE=php]
<tr>

                <td width="255">
                <?
                    if($arr[6] != 'Admin' || $arr[6] != 'SysAdmin') 
                    {
                ?>
                    <div align="center"><img src="images/bill.png" alt="Bill" /></div>
                <?                      
                    }
                    else                        
                    {
                ?>
                    <div align="center"><a href="underConstruction.php"><img src="images/bill.png" alt="Bill" /></a></div>                  
                <?  
                    }
                ?>
                </td>

</tr>
[/CODE]

May

Hi R0bb0b,

I echoed my $query and this is how it looks:

[CODE=mysql]
SELECT * FROM tsttbills where DATE_FORMAT(billDate, '%b-%e-%Y') between 'Nov-1-2007' and 'Nov-9-2007'
[/CODE]

When I copied this query and pasted it into the MySQL Query Browser and ran it, I got the entire table of data displaying...

Hello R0bb0b,

I was able to remove the testGCR.php code from the results page and I tested it with the following data:

[LIST]
[*]Start Date = Nov-1-2007
End Date = Nov-1-2007
I got all the records with the billDate = Nov-1-2007

[*]Start Date = Nov-2-2007
End Date = Nov-2-2007
I got all the records with the billDate = Nov-2-2007

[*]Start Date = Nov-1-2007
End Date = Nov-9-2007
I did not get all the records with the billDate between the start and end date stated above, instead I got [COLOR="Red"]all[/COLOR] the data from the table...
[/LIST]

Here is my sql query:
[CODE=mysql]
$query = "SELECT * FROM tsttbills where DATE_FORMAT(billDate, '%b-%e-%Y') between '$sDate' and '$eDate'";
[/CODE]

Strange?!? :-/ ...I'm just editing my script with the changes you said to, and saving it in the folder on the server...and running it on the browser...I selected the dates from the pop-up calender, and click the generate button...that's all...

i have now added the ob_end_flush(); line at the end of the testGCR.php script, as well as set the code to only echo the data found, not to download it into the .csv...let me run that and let you know...

[B]__[/B]
In my output, I am seeing the form as well as the results...can't figure out why, but still looking

Hi R0bb0b,

Firstly, let me thank you for all that you've done till now, I am truely grateful for your guidance.... :)

Now the problem at hand:
I made the necessary changes and it works to an extent...here are the outcomes:

[LIST=1]
[*]When I select the dates: Nov-1-2007 and Nov-9-2007, I am getting all the records in the table (which is wrong) [B]but[/B] when I select the dates: Nov-1-2007 and Nov-1-2007, I get the records for that date only. :confused:

[*]When I save the .csv file, I cannot open it in a MS Excel (this was working earlier on in this thread), I am getting a file is corrupt message, but the .csv file [B]can only[/B] open in notepad/any text application. :confused:

[*]The .csv file not only has the records from the table but also the entire code from the testGCR.php file. :confused:
[/LIST]

If I am not mistaken, some of these problems we got before (earlier on in this thread), because that was the reason behind the change of the billDate data-type etc.

:confused: :confused: :confused:

[U]2 questions though...[/U]
[LIST=1]
[]why did you use the ob_start()?
[
]and why didn't you use the ob_end_flush()?
[/LIST]

May

[CODE=php]
.
.
.
include('./connect.php');
global $conn;

// Start our query of the database 
$query = "SELECT * FROM tsttbills where DATE_FORMAT(billDate, '%b-%e-%Y') >= '$sDate' and DATE_FORMAT(billDate, '%b-%e-%Y') <= '$eDate'";

$sql = mysql_query($query, $conn);  
//echo $sql;
echo $query . "<br /><br />" . mysql_num_rows($sql) or die("Error: ".mysql_error());                    

.
.
.
[/CODE]
the result displayed is [B]1[/B]

but the connection script works properly for all the other parts of the application...

Here is the code....and still nothing shows...
[CODE=php]
.
.
.
include('./connect.php');
global $conn;

// Start our query of the database 
$query = "SELECT * FROM tsttbills where DATE_FORMAT(billDate, '%b-%e-%Y') >= '$sDate' and DATE_FORMAT(billDate, '%b-%e-%Y') <= '$eDate'";

$sql = mysql_query($query, $conn) or die("Error: ".mysql_error());  
echo $sql;

.
.
.
[/CODE]

I have those 2 statements already...and it doesn't echo anything...

I think the problem lies here

[code=php]
$sql = mysql_query($query, $conn);
[/code]
it doesn't echo anything, but if I remove the $conn, I get the "Resource ID#6" error being displayed...:confused: :confused: :confused:

I added it here:
[code=php]
.
.
.
include('./connect.php');
global $conn;

        // Start our query of the database 
        $query = "SELECT * FROM tsttbills where DATE_FORMAT(billDate, '%b-%e-%Y') >= '$sDate' and DATE_FORMAT(billDate, '%b-%e-%Y') <= '$eDate'";

        $sql = mysql_query($query, $conn);  

        echo $query . "<br /><br />" . mysql_num_rows($sql);    

.
.
.
[/code]

and this is the result:
[code=mysql]
SELECT * FROM tsttbills where DATE_FORMAT(billDate, '%b-%e-%Y') >= 'Nov-1-2007' and DATE_FORMAT(billDate, '%b-%e-%Y') <= 'Nov-1-2007'

[/code]

sigh...ok, so I looked over the syntax in the db manager program, and I realized that I actually copied it twice and then tried to execute that...:$ :icon_redface: :$

It works, and I am getting the 10072 records returned...

here is the error message:

[QUOTE]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM tsttbills where DATE_FORMAT(billDate, '%b-%e-%Y') >= 'Nov-1-2007' ' at line 1

Error No. 1064[/QUOTE]