Re[2]: [PHP-WIN] ASP => PHP

From: Date: Wed, 06 Sep 2000 15:09:34 +0000
Subject: Re[2]: [PHP-WIN] ASP => PHP
References: 1 2 3 4  Groups: php.windows 
Request: Send a blank email to php-windows+get-2478@lists.php.net to get a copy of this message
> But i got a error as: > Warning: SQL error: [Microsoft][ODBC Driver Manager] invalidation String or > buffer length, SQL state S1090 in SQLConnect in > F:\php\program\test\test5.phtml on line 7 > <? > $cnpath = "DBQ=F:\\Inetpub\\iissamples\\sdk\\asp\\database\\authors.mdb"; > $driver = "DRIVER={Microsoft Access Driver (*.mdb)};"; > $dsn = $driver.$cnpath; For MS ODBC you must first go to control panel and define a DSN, and then call only the DSN, which contains all driver specification for one database. So if you declare, a DSN for authors.mdb called "authors", all you need is: $dsn = "authors"; //no path, no driver, no cnpath > $usuario = ""; Also, if you haven't changed the default security in MS Access, then your username should be "Admin", no password. > $senha = ""; > $connect = odbc_pconnect($dsn, $usuario, $senha); ?>> Or without vars: $connect=odbc_pconnect("authors","Admin",""); Gonzalo.

« previous php.windows (#2478) next »