Solved

# PHP ODBC Connection

Posted on 2010-09-15
1,241 Views
I have been working on this for months.  I have finally successfully been able to connect to the Timberline database through PHP and a web browser using and ODBC connection.  This is for a future Intranet website we are implementing for our company.

What I have created is a form page when submitted, that username and password is sent to the odbc_connect command.  This connects fine with only one specific user.  When resetting iis and starting up the web page again, i am able to connect again with a different user but only that user i use...  no other.

What is causing the odbc connection to remain only available to one user at a time?  I have used odbc_close to close the connection but it only seems to "officially close" if i run iisreset and start the web page again.

\$conn = odbc_connect('Driver={Timberline Data};DBQ=\\\\path\\to\\database\\','username','password');

0
Question by:the-miz
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 6
• 5
• 2

LVL 42

Expert Comment

ID: 33682114
It seems the first connection is exclusive and it should be some database property which restricts number of concurrently connected users. You have to check database docummentation for more details. BTW, are you able to connect the database from two different client tools?

odbc_close may fail e.g. when some transaction is open.

You have to check error messages by monitoring backend database in some SQL profiler when the connection attempt fails or ODBC closing is not complete.
0

Author Comment

ID: 33683033
What I have noticed is I can open the database with Excel and read a table into it, but to read another table into it, I must use the same username and password.  I have to close the Excel program and re-open it to use a different login.

I'm assuming this is the same with my php intranet site.  That it sees the w3wp as the application accessing it.  I can only use that specific username and password, if I want to you a different one, I must run iisreset to restart my intranet website.

I can login with different users with different tools, for example...  login with Excel and then login with Access with another.

I think I need someone that knows the Timberline database well, in order to tell me how I may allow concurrent uses to use the same application.
0

LVL 42

Expert Comment

ID: 33683258
Yes, unfortunately.

Why you don't use e.g. MySQL which is better supported?
0

Author Comment

ID: 33684802
I'd love to use MySQL but the software my company uses is the Sage Timberline Office, which also somehow uses the Pervasive database in order to connect to its DB.  I'm trying to find a way to make the database think that the application has stopped using the database in order for another users login can be used through the intranet page.
0

LVL 42

Expert Comment

ID: 33685047
If the company decided about the database then it was probably due to the good reliability, support and documentation, so it should not be a problem to find such simple thing.
0

Author Comment

ID: 33685511
Should not be a problem to find such a simple thing?  And this is your "expert" comment/solution.  I hope I'm not paying for access to this exchange for cop-out comments like that.
0

LVL 42

Expert Comment

ID: 33685725
I am just a volunteer as other experts here and no one of use will see your money...

I know this answer cannot give you a satisfaction but you should understand not all specific and niche market products can be supported here and Sage software is so rarely used that it is really hard to find expert which would be waiting here for this kind of question. (I am here over one year and this the first question about the Timberline database.)

The question is still in your hands. You may delete it, you may accept some of your comments as an answer, etc. All possible options are described in help section.

BTW, didn't you use  limited Timberline ODBC driver. The full version is a paid product.
0

LVL 18

Accepted Solution

mirtheil earned 500 total points
ID: 33687574
"What I have noticed is I can open the database with Excel and read a table into it, but to read another table into it, I must use the same username and password.  I have to close the Excel program and re-open it to use a different login. "

What error are you actually getting?  From  a Pervasive DB perspective there is no limit on a specific user logging in.
There are a number of Sage (including Timberline) users doing what you want.
0

Author Comment

ID: 33691745
Basically here are my steps and error message I get in Excel 2007:

Click the Data Tab, Click Connections, Add a connection using the ODBC Timberline driver.  This prompts me for my Timberline Username and Password.  It allows me to select a table.  This adds the connection to the list and I close the pop-up window.

I then go to Existing Connections and double-click the connection I just created, this prompts me on how I would like to import the data into the spreadsheet.

When I go back after filling my data into the spreadsheet and attempt to add another connection with a different Timberline Username and Password I get the error that it is an Invalid user or password specified.  Which I know it is not.

Now I got the run-around from Timberline about its database.  One told me they no longer use Pervasive but an SQL base DB, yet Pervasive gets installed on our workstations and if I run W3MONV75 I can see who is connected and what files are in use.

We have the paid product of Timberline and full support from them, but that does not include back-end or development support.
0

LVL 18

Expert Comment

ID: 33691944
Can you post the exact error you get?  Are you getting the same error through PHP?  Do you have a Pervasive ODBC driver listed in ODBC Administrator?  Can you point to that instead of the Timberline driver?
0

Author Comment

ID: 33693466
The exact error is a alert message box Logon Error  Invalid user id or password specified.  This is only in Excel, PHP does not send out an error message, at least I have not been able to receive one other than it cannot connect to the database.

I am confused how Pervasive even works..  when I connect to using Pervasive's driver, there are only 3 databases in there, one called DEFAULTDB, DEMODATA, TEMPDB.  When I connect using PCC tool it shows me these databases but nothing in them except in System Objects, Tables.
0

LVL 42

Expert Comment

ID: 33696390
I've been asking already but I have to ask again: Does your database have something like Profiler? It will report all traffic on the backend and all errors which will appear. Also if you connect from .NET then the error message will appear including error number which is then traceable in documentation.
0

Author Closing Comment

ID: 33906407
Use workaround
0

## Featured Post

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
###### Suggested Courses
Course of the Month6 days, 17 hours left to enroll