php-windows Digest 6 Feb 2006 12:22:34 -0000 Issue 2882

Topics (messages 26678 through 26681):

mssql_connect somtimes returns NULL
        26678 by: Robert Wheadon

mssql_connect sometimes returns FALSE
        26679 by: Robert Wheadon
        26680 by: Robert Wheadon

Returning binary data - HOW?
        26681 by: Dave Brown

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Hi There,

I've written a script to connect to SQL Server 2000 (SP3).  Most of the time
it connects, but sometimes I get a "Connect failed" message.  I am running
on Windows 2000 SP4.  The script is listed below.

<?php
    $rteConnection = mssql_connect("atlantis", "simon", "simon");

    if($rteConnection == FALSE)
    {
        echo "Connect failed ".strftime("%H:%M:%S
").mssql_get_last_message();
    }
    else
    {
        echo "Connected ".strftime("%H:%M:%S ".mssql_get_last_message());
        if(!mssql_close($rteConnection))
        {
            echo "Close Failed.";
        }
    }
    phpinfo();
?>

I can't seem to get any more error information.  Has anyone got a clue about
why the dbopen routines (in mssql) would fail intermittently.

Thanks,

 Robert




--- End Message ---
--- Begin Message ---
Hi There,

I've written a script to connect to SQL Server 2000 (SP3).  Most of the time
it connects, but sometimes I get a "Connect failed" message.  I am running
on Windows 2000 SP4.  The script is listed below.

<?php
    $rteConnection = mssql_connect("atlantis", "simon", "simon");

    if($rteConnection == FALSE)
    {
        echo "Connect failed ".strftime("%H:%M:%S
").mssql_get_last_message();
    }
    else
    {
        echo "Connected ".strftime("%H:%M:%S ".mssql_get_last_message());
        if(!mssql_close($rteConnection))
        {
            echo "Close Failed.";
        }
    }
    phpinfo();
?>

I can't seem to get any more error information.  Has anyone got a clue about
why the dbopen routines (in mssql) would fail intermittently.

Thanks,

 Robert


--- End Message ---
--- Begin Message ---
Hi There,

I've written a script to connect to SQL Server 2000 (SP3).  Most of the time
it connects, but sometimes I get a "Connect failed" message.  I am running
on Windows 2000 SP4.  The script is listed below.

<?php
    $rteConnection = mssql_connect("atlantis", "simon", "simon");

    if($rteConnection == FALSE)
    {
        echo "Connect failed ".strftime("%H:%M:%S
").mssql_get_last_message();
    }
    else
    {
        echo "Connected ".strftime("%H:%M:%S ".mssql_get_last_message());
        if(!mssql_close($rteConnection))
        {
            echo "Close Failed.";
        }
    }
    phpinfo();
?>

I can't seem to get any more error information.  Has anyone got a clue about
why the dbopen routines (in mssql) would fail intermittently.

Thanks,

 Robert

--- End Message ---
--- Begin Message ---
Hi - I've been stuck on this for 12 hours now and run out of ideas.
Wondering if someone can help me?

My PHP page calls a COM object which is supposed to return some binary data
which is then sent back to the user. The problem I have is that once the
call to my COM object is done, PHP thinks the returned binary string is
actually 1/2 the size because it's interpreting it as wide characters.

I've tried returning both a BSTR and a VARIANT (Safearray of VT_UI1), and
both end up 1/2 size.  Does anyone know if it's possible to have a com
object allocate say 128 bytes of data, and return it to PHP in a way that
128 bytes of data are written out to the requesting browser?

My php looks like this:

$inputBuf = "some data";
$myObject = new COM("BinarySource.BinarySourceObj");
$outputBuf = myObject->createBinaryData( $inputBuf ); // this object returns
128 *bytes* of data
print( $outputBuf ); // This sends out only 64 bytes!!

I've tried both of these for my COM object, and both result in 1/2 the # of
bytes sent:

HRESULT createBinaryData([in] BSTR source, [out, retval] BSTR*
outputBuffer);
HRESULT createBinaryData([in] BSTR source, [out, retval] VARIANT*
outputBuffer);

**NOTE: This COM object works if I use an ASP page and call ASP's
Response.BinaryWrite() function with the version that returns a VARIANT.

Any ideas??

Thank you!

--- End Message ---

Reply via email to