odbc_connect unknown error

--_212a1eed-f8d2-4dcd-bbfa-c111e6c84b92_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hello!.

I have a problem when trying to connect to an access database:

$con =3D odbc_connect($dsn,$user,$pass) or die(odbc_error());

the error message i get is just this:
IM002

the $dsn var only contains the name of a data source previously created fro=
m the windows control panel.
i already tested the $dsn making a connection with visual basic code and it=
works fine.
Also the user and pass are right. so i dont know what could be the problem.=


I am using PHP 5.2.4-win32. with apache 2.2.4.

I really appreciate any help on this.
Alexander
____________________________________________________________ _____
Invite your mail contacts to join your friends list with Windows Live Space=
s. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=3Dcreate&wx_ url=3D/friends.=
aspx&mkt=3Den-us=

--_212a1eed-f8d2-4dcd-bbfa-c111e6c84b92_--
Alexander Fradiani [ Do, 20 September 2007 01:37 ] [ ID #1825472 ]

Re: odbc_connect unknown error

I'd check the following in order...

1) Does the user running the web process have access to the file using
the path provided?
2) Did you set the DSN as a System DSN?
3) Try using a DSN-less connection, namely:

$dsn = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" + $fullpathtodb;
$con = odbc_connect($dsn,$user,$pass) or die(odbc_error());

John

On 9/19/07, Alexander Fradiani <a_fradiani [at] hotmail.com> wrote:
>
> Hello!.
>
> I have a problem when trying to connect to an access database:
>
> $con = odbc_connect($dsn,$user,$pass) or die(odbc_error());
>
> the error message i get is just this:
> IM002
>
> the $dsn var only contains the name of a data source previously created from the windows control panel.
> i already tested the $dsn making a connection with visual basic code and it works fine.
> Also the user and pass are right. so i dont know what could be the problem.
>
> I am using PHP 5.2.4-win32. with apache 2.2.4.
>
> I really appreciate any help on this.
> Alexander
> ____________________________________________________________ _____
> Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
> http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_ur l=/friends.aspx&mkt=en-us


--
--
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic [at] gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
John Mertic [ Do, 20 September 2007 21:28 ] [ ID #1825473 ]

RE: odbc_connect unknown error

--_55edfdf2-c75a-4c26-8b6c-514e3c5e5f0e_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


> 1) Does the user running the web process have access to the file using> t=
he path provided?> 2) Did you set the DSN as a System DSN?> 3) Try using a =
DSN-less connection, namely:> > $dsn =3D "Driver=3D{Microsoft Access Driver=
(*.mdb)}; DBQ=3D" + $fullpathtodb;> $con =3D odbc_connect($dsn,$user,$pass=
) or die(odbc_error());> > John
Ok, it worked fine using the extended connection string you wrote in the ex=
ample.
I wonder if there is a way to connect to a remote database, what i'm doing =
now is upload the .mdb file to the server and use it as local, but it would=
be better connect to the remote system.
____________________________________________________________ _____
Invite your mail contacts to join your friends list with Windows Live Space=
s. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=3Dcreate&wx_ url=3D/friends.=
aspx&mkt=3Den-us=

--_55edfdf2-c75a-4c26-8b6c-514e3c5e5f0e_--
Alexander Fradiani [ Do, 20 September 2007 23:28 ] [ ID #1825474 ]

Re: odbc_connect unknown error

You can if the user that runs the web server process has access to
that file then yes. Or you could set an ODBC bridge, but to be honest
it's much faster and easier ( depending upon the application's
requirements of course ) to export it to a SQLite or MySQL DB on the
webserver.

John

On 9/20/07, Alexander Fradiani <a_fradiani [at] hotmail.com> wrote:
>
> > 1) Does the user running the web process have access to the file using
> > the path provided?
> > 2) Did you set the DSN as a System DSN?
> > 3) Try using a DSN-less connection, namely:
> >
> > $dsn = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" + $fullpathtodb;
> > $con = odbc_connect($dsn,$user,$pass) or die(odbc_error());
> >
> > John
>
> Ok, it worked fine using the extended connection string you wrote in the
> example.
> I wonder if there is a way to connect to a remote database, what i'm doing
> now is upload the .mdb file to the server and use it as local, but it would
> be better connect to the remote system.
>
> ________________________________
> Invite your mail contacts to join your friends list with Windows Live
> Spaces. It's easy! Try it!


--
--
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic [at] gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
John Mertic [ Fr, 21 September 2007 03:20 ] [ ID #1826496 ]
PHP » gmane.comp.php.windows » odbc_connect unknown error

Vorheriges Thema: SFTP connections via PHP
Nächstes Thema: Outlook 2007