RE: [PHP] ASP => PHP
| From: | Joseph Okomba | Date: | Wed, 06 Sep 2000 04:47:05 +0000 |
| Subject: | RE: [PHP] ASP => PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15460@lists.php.net to get a copy of this message | ||
You will need to create your DSN beforehand (through the ODBC applet in the
Control Panel, assuming you're using windows) to make the ODBC connection.
ADO works a bit differently since it can connect natively to MS Access. PHP
will check the system for DSN before making an ODBC connection.
Cheers.
> -----Original Message-----
> From: alacr@carneiroramos.com.br [SMTP:alacr@carneiroramos.com.br]
> Sent: Tuesday, September 05, 2000 9:29 PM
> To: php-general@lists.php.net
> Subject: [PHP] ASP => PHP
>
> Please, help me !
>
> Como transformar os comandos abaixo (ASP) para (PHP) ?
>
> In ASP :
>
> <%
> set conntemp=server.createobject("adodb.connection")
> cnpath="DBQ=" & server.mappath("alacr.mdb")
> conntemp.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath
> .
> .
> conntemp.close
> %>
>
> In PHP :
> (DON'T WORK) I tried the following :
>
> <?php
> $cnpath = "DBQ=c:\apache\wwwroot\alacr.mdb";
> $driver = "DRIVER={Microsoft Access Driver (*.mdb)}; ";
> $dsn = $driver.$cnpath;
> $usuario = "";
> $senha = "";
> $connect = odbc_pconnect($dsn, $usuario, $senha);
> .
> .
> odbc_close($connect);
> ?>
>
> Thank you
> Alvaro Luiz