[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

My mdb database does not work when i upload it?

Posted on 2009-05-02
9
Medium Priority
?
365 Views
Last Modified: 2012-05-06
when i am using mdb database and upload it , do i need to configure on the net from somewhere else like we do when we do on localhost?

my programs are working fine on localhost but not fine when i upload the database. it seems it is not picking up the database.

i have a very simple program which counts the total no. of rows in the database.
it it running on localhost but not on server when i upload it.
<?php
 
// it shows the total no. of records that are returned in the database.
 
$conn=odbc_connect('win','',''); //database name is win
$sql="select count(*) as cnt from customers";
$row=odbc_exec($conn, $sql);
if(odbc_fetch_row($row)){
        echo $cnt = odbc_result($row, 1);
}
 
?>

Open in new window

0
Comment
Question by:designersx
  • 7
  • 2
9 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 375 total points
ID: 24289474
If you're working with .mdb files, it would seem you'd need the full name, i.e. "win.mdb" ...

However: Can you verify whether your connection is actually made? After your odbc_connect call, can you then add a line that would show whether or not this connection is in fact valid?

"localhost" has no meaning to Access databases ... Access is a file-server type database, and requires no specific platform on which to run.

Are you sure your webserver has the correct permissions to run the database? The folder hosting the database will need at least Modify permissions in order to run it.
0
 

Author Comment

by:designersx
ID: 24289548
when i run any program related to the mdb database using odbc connection, we need to make a connection first. steps are as follows:-

1) we go to the control panel.
2) there we go the administrative tools.
3) after this there is a icon of odbc (Data Sources)
4) we double click on it and window of data source administrator opens and then going in the system dsn tab , we click on add button and add the databases here, then we enable to make a interaction with mdb database using odbc connection.

but when i am uploading all my files, how do i be able to make a connection with database. this i smy problem, please help me out. i am just sending u the snapshots of how we do in the localhost but how should we do on the server.
0
 

Author Comment

by:designersx
ID: 24289641
1) when i am running on the localhost, then i wrote only win and not win.mdb, so that means u wanna say when i write win.mdb and try , i will through.

2) sir how can i check whether a connection is valid?

3) my other projects are running here but for them i have used mysql database ofr them , so i have not used before. this thing i wll ask from my boss.

just once please clear my first point.
 
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:designersx
ID: 24292420
sir i have used win.mdb but this i m not able to do make interaction with mdb. please help.
0
 

Author Comment

by:designersx
ID: 24292431
when i run this code on localhost, msg comes connection is valid
but on server msg comes, error in the connection.

why is this so? there comes problem in making the connection?
<?php
 
// it shows the total no. of records that are returned in the database.
 
echo $conn=odbc_connect('win','','');
if($conn)
	echo "connection is valid";
else	
	echo "error in the connection".odbc_error();
exit;
$sql="select count(*) as cnt from customers";
$row=odbc_exec($conn, $sql);
if(odbc_fetch_row($row)){
	echo $cnt = odbc_result($row, 1);
}
 
?>

Open in new window

0
 

Author Comment

by:designersx
ID: 24292500
error in the connectionIM002

this is the exact error msg coming. what is IM002??
0
 

Author Comment

by:designersx
ID: 24292527
the problem is because i have not entered the username and password.

please tell me in odbc_connect(), what username and password we fill?

odbc_connect('database name','username of mdb database','password of mdb database')

am i right???
0
 
LVL 85
ID: 24293837
You've opened several other questions for this issue ... EE guidelines allow only one question per issue.

0
 

Author Comment

by:designersx
ID: 24294158
ok fine, sry
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month19 days, 22 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question