php-windows Digest 21 Jun 2005 11:30:40 -0000 Issue 2702

Topics (messages 26124 through 26126):

Re: Access connection
        26124 by: Michael Louie Loria
        26125 by: Piotr Pluciennik

GTK and PHP5?
        26126 by: Joakim Ling

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 ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

>> Subject:
>> Access connection
>> From:
>> "Matt Murphy" <[EMAIL PROTECTED]>
>> Date:
>> Mon, 20 Jun 2005 16:33:52 -0500
>> To:
>> <[email protected]>

Here's a source code. Maybe you could try this but
it's OLE DB. It's
tested with NWIND or Northwind Access database. Just
the line $db =
'C:\\Program Files\\Microsoft Visual
Studio\\VB98\\NWIND.mdb'; if it's
on a diff. directory

- - - - - -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<?

$db = 'C:\\Program Files\\Microsoft Visual
Studio\\VB98\\NWIND.mdb';

$conn = new COM('ADODB.Connection');

// Two ways to connect. Choose one.
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=$db");
//$conn->Open("DRIVER={Microsoft Access Driver
(*.mdb)}; DBQ=$db");

$sql = 'SELECT   ProductName, QuantityPerUnit,
UnitPrice
        FROM     Products
        ORDER BY ProductName';
$rs = $conn->Execute($sql);

?>

<table>
<tr>
        <th>Product Name</th>
        <th>Quantity Per Unit</th>
        <th>Unit Price</th>
</tr>
<? while (!$rs->EOF): ?>
        <tr>
                <td><?= $rs->Fields['ProductName']->Value ?></td>
                <td><?= $rs->Fields['QuantityPerUnit']->Value
?></td>
                <td><?= $rs->Fields['UnitPrice']->Value ?></td>
        </tr>
        <? $rs->MoveNext() ?>
<? endwhile ?>
</table>

<?

$rs->Close();
$conn->Close();

?>
</body>
</html>
- - - - -

Michael Louie Loria
-----BEGIN PGP SIGNATURE-----
Comment: GPG Public Key:
https://www.biglumber.com/x/web?qs=0x4A256EC8
Comment: GPG Public Key:
http://www.lorztech.com/GPG.txt
Comment: Yahoo ID: michaellouieloria

iD8DBQFCsGwqEWLHf0olbsgRA+7KAJ9X3RBoA7//y9wQBcbjjPveNNG76gCgiGqG
6X8AjM0JbYLfwhi2ZnX7uzY=
=3nSR
-----END PGP SIGNATURE-----

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

probably you have to set necessary permissions to your
database file under Windows.

HTH
Piotr

--- Matt Murphy <[EMAIL PROTECTED]> wrote:

>  
> 
> All, 
> 
> I'm moving a LAMP site to windows and I'm having one
> small hurdle. I'm
> trying to connect to an access db that's used by our
> UPS software, so I
> can access status of shipments. I'm using an odbc
> connection, and
> amazingly, while it works under linux, it does not
> under windows! I've
> set the odbc config in the control panel to what I
> think should be
> correct, but I'm getting this error:
> 
> Warning: odbc_connect(): SQL error: [Microsoft][ODBC
> Microsoft Access
> Driver] The Microsoft Jet database engine cannot
> open the file
> '(unknown)'. It is already opened exclusively by
> another user, or you
> need permission to view its data., SQL state S1000
> in SQLConnect in
> C:\www\html\portal\ups_tracking.php on line 126
> 
> Line 126 is: $myDB = odbc_connect('UPSDB','','');
> 
> Thanks!
> 
> Matt
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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

Is it possible to use GTK WIN with PHP5?

 

Cheers

 


--- End Message ---

Reply via email to