Welcome Guest ( Log In | Register )

Bump TopicReply to this topicRSS feed Start new topic Start Poll

Outline · [ Standard ] · Linear+

> remote odbc connect - php and msaacess

kayul
post May 19 2017, 03:55 PM, updated 2w ago
New Member
*
Group: Junior Member
Posts: 5

Joined: May 2017
Hello

Im trying to connect php and msaccess in my old unused server

Im using the code below in connecting php and ms access and so far it working fine when i add System DSN to fetch database locally

but when the database is in remote location i receive the message connection failed

CODE


$conn=odbc_connect('northwind','','');

if (!$conn)

 {exit("Connection Failed: " . $conn);}

$sql="SELECT * FROM customers";

$rs=odbc_exec($conn,$sql);

if (!$rs)

 {exit("Error in SQL");}

echo "";

echo "";

echo "";

while (odbc_fetch_row($rs))

{

 $compname=odbc_result($rs,"CompanyName");

 $conname=odbc_result($rs,"ContactName");

 echo "";

 echo "";

}

odbc_close($conn);

echo "
CompanynameContactname
$compname$conname
";



http://w3schools.sinsixx.com/php/php_db_odbc.asp.htm

user posted image

This post has been edited by kayul: May 19 2017, 04:07 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Eventless
post May 19 2017, 09:13 PM
Look at all my stars!!
*******
Group: Senior Member
Posts: 2,438

Joined: Jan 2003
What OS are you using on the local and remote server?

Can you access the remote server using the windows share from your local server?

Do you have read write access on the shared folder and files?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
kayul
post May 21 2017, 10:31 PM
New Member
*
Group: Junior Member
Posts: 5

Joined: May 2017
QUOTE(Eventless @ May 19 2017, 09:13 PM)
What OS are you using on the local and remote server?

Can you access the remote server using the windows share from your local server?

Do you have read write access on the shared folder and files?
*
Thank you eventless

after two days trying to solve this probelm.. my mistake was i used ip address instead of computer name..all now is working fine.. bangwall.gif

Hope this will help someone

im using windows server 2003 btw
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Eventless
post May 21 2017, 11:58 PM
Look at all my stars!!
*******
Group: Senior Member
Posts: 2,438

Joined: Jan 2003
QUOTE(kayul @ May 21 2017, 10:31 PM)
Thank you eventless

after two days trying to solve this probelm.. my mistake was i used ip address instead of computer name..all now is working fine..  bangwall.gif

Hope this will help someone
*
There is no reason why it should fail when using ip address. One possible cause is that your server IP address is not fixed.

QUOTE(kayul @ May 21 2017, 10:31 PM)
im using windows server 2003 btw
*
That is a dead OS. You would be better off if you formatted that server and used an open source alternative if you can't afford to buy a new version of Windows Server. Who knows how many vulnerabilities are exposed on such an old OS? The recent WannaCry ransomware can infect those servers if they are unpatched.
https://en.wikipedia.org/wiki/WannaCry_ransomware_attack

User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Bump TopicReply to this topicTopic OptionsStart new topic
 

Switch to:
| Lo-Fi Version
0.0391sec    4.70    5 queries    GZIP Disabled
Time is now: 29th May 2017 - 11:08 PM