locked
Does MS-Access's Linked tables are supports on PHP RRS feed

  • Question

  • HI,  
    I have a ms-access file which has linked table. The linked table is connected to a ODBC source (e.g MS-SQL or 3rd Party ODBC Driver).
    WebPage(php) Apache (Windows), connecting to a ODBC DSN of MS-Access, MS-Access is having linked tables. Linked tables as from another ODBC source.
    On the PHP Page,  When I am trying to connect the  ms-access odbc dsn , I am able to connect.
    But when I query any of the linked tables, PHP is not able to query and is failing.

    Does php has capabilities to read/write to linked tables in ms-access file.
    Or it is issue with MS-Access
    Or is it I am missing something.

    Regards
    Rajendra Dewani    

    Rajendra Dewani
    Website : http://www.dewani.net

    Tuesday, November 11, 2014 11:06 AM

Answers

  • Hi Rajendra,

    >> but it could be issue with ms-access file which is not supporting or needs any special format or option in ms-access<<

    In my option, if ADO.NET could access the link table successfully, then I think the ODBC Driver is working correctly. So I suspect this issue is in the Data Access Level, in this case, it is PHP Data Provider.

    ADO.NET -> Access ODBC Driver -> Access Database (work)

    PHP Data Provider -> Access ODBC Driver -> Access Database (not work)

    Hope it is helpful.

    Regards & Fei 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 21, 2014 2:51 AM

All replies

  • per your description there are no Access tables if the Access application is linking to another app for its data

    this is a very common design whereby the User Interface is in the Access Front End with no tables - and then links to another file that holds the tables that may or may not be an Access application.  The front end has no tables.  You will see a little arrow icon next to the tables in the Access navigation pane indicating the tables are really not in the file but are linking in from somewhere else.

    the php would also need to directly link to the other app that has the data - not to the Access FE

    having said that; yes a php app can link to Access tables when they do exist; but classic Access tables are passive and do not make a good back end database although that is now changing in the web app features now coming out with the product 

    Tuesday, November 11, 2014 5:33 PM
  • Hi Rajendra Dewani,

    Based on the description, you are not able to query linked tables from ODBC data source in Access.

    As far as I test, I can use ADO.Net(ODBC) to connect Access database, and query the linked tables from ODBC data source. I created an Access database and use ODBC to connect SQL server. There is a table named dbo_Task in Access linked from SQL server.

    Here is the code:

       public void Query()
            {
                string connectionString = @"Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\Users\UserName\Documents\Person.accdb";            
                string queryString ="select * from dbo_Task";
                DataSet ds =new DataSet();
                ds = GetDataSetFromAdapter(ds, connectionString, queryString);
            }
    
            private DataSet GetDataSetFromAdapter(
        DataSet dataSet, string connectionString, string queryString)
            {
                using (OdbcConnection connection =
                           new OdbcConnection(connectionString))
                {
                    OdbcDataAdapter adapter =
                        new OdbcDataAdapter(queryString, connection);
    
                    // Open the connection and fill the DataSet. 
                    try
                    {
                        connection.Open();
                        adapter.Fill(dataSet);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                    // The connection is automatically closed when the 
                    // code exits the using block.
                }
                return dataSet;
            }
    

    I suggest that you test the code above to see where this issue is relatvie to PHP.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 12, 2014 3:02 AM
  • Hi,

    Do you mean to say its an limitation on MS-Access, that php cannot read Linked table Or do you mean to say its an limitation with PHP ?

    for few limitations I cannot connect the other app/database/driver directly and have to go via MS-Access's linked table.


    Rajendra Dewani
    Website : http://www.dewani.net

    Friday, November 14, 2014 11:12 AM
  • Hi,

    Thank you for sharing the code,

    ASP.NET is not an issue, its the PHP.

    I used standard code sample. I am able to connect to direct tables but not linked tables.


    Rajendra Dewani
    Website : http://www.dewani.net

    Friday, November 14, 2014 11:15 AM
  • Hi Rajendra Dewani,

    >>ASP.NET is not an issue, its the PHP.<<

    Did you mean the issue only occur in PHP? If I understood correctly, I suggest that you get more effective response from PHP.

    If not, what's the database you are linking to from the Access? Since the test linking to SQL server worked for me, I suspected the issue may be relative to the database you linked.

    >>I used standard code sample. I am able to connect to direct tables but not linked tables.<<

    The code sample above is able to query the linked tables, did you have changce to test it to narrow down this issue?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 18, 2014 2:22 AM
  • Hi,

    Yes issue happens only when using php, when using asp.net the same ms-access file works.

    Did you tested linking SQL server tables on ms-access and querying the table using "PHP" ?


    Rajendra Dewani
    Website : http://www.dewani.net

    Tuesday, November 18, 2014 12:21 PM
  • Hi Rajendra Dewani,

    Thanks for the detail information about this issue.

    >>Did you tested linking SQL server tables on ms-access and querying the table using "PHP" ?<<

    No. This forum is for developers to discuss developing issues using lanuage supported by Microsoft. Since the issue is narrow down to the PHP, I suggest that you get more effective response from forum of PHP.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, November 20, 2014 3:11 AM
  • Hi

    I agree, but it could be issue with ms-access file which is not supporting or needs any special format or option in ms-access !!!!

    All I am trying to understand is if its an limitation of ms-access or its limitation of php.

    FYI, I have already posted this question on php forums ( on the same day when i started the thread).


    Rajendra Dewani
    Website : http://www.dewani.net

    Thursday, November 20, 2014 7:23 AM
  • Hi Rajendra,

    >> but it could be issue with ms-access file which is not supporting or needs any special format or option in ms-access<<

    In my option, if ADO.NET could access the link table successfully, then I think the ODBC Driver is working correctly. So I suspect this issue is in the Data Access Level, in this case, it is PHP Data Provider.

    ADO.NET -> Access ODBC Driver -> Access Database (work)

    PHP Data Provider -> Access ODBC Driver -> Access Database (not work)

    Hope it is helpful.

    Regards & Fei 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 21, 2014 2:51 AM