Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1250
  • Last Modified:

PHP ODBC Connection

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');

Open in new window

0
the-miz
Asked:
the-miz
  • 6
  • 5
  • 2
1 Solution
 
pcelbaCommented:
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
 
the-mizAuthor Commented:
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
 
pcelbaCommented:
Yes, unfortunately.

Why you don't use e.g. MySQL which is better supported?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
the-mizAuthor Commented:
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
 
pcelbaCommented:
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
 
the-mizAuthor Commented:
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
 
pcelbaCommented:
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
 
mirtheilCommented:
"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
 
the-mizAuthor Commented:
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
 
mirtheilCommented:
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
 
the-mizAuthor Commented:
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
 
pcelbaCommented:
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
 
the-mizAuthor Commented:
Use workaround
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now