Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Pervasive 2000i on NetWare with PHP

Status
Not open for further replies.

douglagm

MIS
Oct 24, 2003
19
ZA
Hi,

Has anyone tried to access a Pervasive.SQL 2000i (Betrieve 9.94) on a NetWare server using PHP.

The Pervasive db is used by the backup software (Arcserve9) to store all the info regarding the backups. I would like to use PHP to access info stored in this db.

Thanks
 
What platform do you want to use PHP on? Pervasive.SQL 2000i does offer an ODBC driver that I've seen work with the built in ODBC support in PHP on a Win32 platform. There is also a beta of a Linux requester that can be used if you use Pervasive.SQL V8.

info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
Well I can run the PHP on either NetWare or Linux. The NetWare server uses 2000i sp4, so from what I read about the Linux requester it won't work on this version.


For starters, I installed the Pervasive.SQL Control Center on W2K, just to check if I could see the db, but no joy. Under configuration I can see all the changes that I made manually to the bti.cfg, but I can't change them from the Control Center ("Unable to save setting values"). I think it has something to do with the "Listen IP Address" this shows as 0.0.0.0. I think if I manually add the IP it might work, but string do I use to specify the IP?

 
You're right, the Linux requester will only work with Pervasive.SQL V8. The Listen IP address only applies if you have multiple NICs in the server.
Do you see the DEMODATA database from the Win2k machine? Are you able to access it? If not, what's the error?
Can you post the BTI.CFG?
Here's a PHP page I've used on Windows to test connectivity. It uses the DEMODATA Datasource.
Code:
<html>
<title>ODBC PHP Test</title>
<body>
<p>This connects to an ODBC DSN through PHP and displays the information in a table.</p>
<hr>
<table width=&quot;75%&quot; border=&quot;1&quot; cellspacing=&quot;1&quot; cellpadding=&quot;1&quot; bgcolor=&quot;#FFFFFF&quot;> 
  <tr bgcolor=&quot;#0000FF&quot;>  
    <td height=&quot;22&quot;><b>Class ID</b></td> 
    <td height=&quot;22&quot;><b>Class Name</b></td> 
    <td height=&quot;22&quot;><b>Section</b></td> 
  </tr> 
<? 
// connect to a DSN &quot;DEMODATA&quot; with no user or password
$connect = odbc_connect(&quot;demodata&quot;, &quot;&quot;, &quot;&quot;);

// query the users table for name and surname
$query = &quot;SELECT id,name, section FROM class&quot;;

//Prepare the statement
$result = odbc_prepare ($connect, $query);

// execute the query
odbc_execute($result);

// fetch the data from the database
while(odbc_fetch_row($result)){
  $id = odbc_result($result, 1);
  $name = odbc_result($result, 2);
  $section = odbc_result($result, 3);	
  print (&quot;<tr>&quot;); 
  print (&quot;<td>$id</td>&quot;); 
  print (&quot;<td>$name</td>&quot;); 
  print (&quot;<td>$section</td>&quot;); 
  print (&quot;</tr>&quot;); 
}


// close the connection
odbc_close($connect);
?>

</table> 
</body> 
</html>

info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top