Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2007
    Posts
    12

    Unanswered: Web application reading/writing to Pervasive database

    Hello, I am a newbie so please excuse me if this is a dumb question. I have been reading and trying for two days now but I don't even think I have started

    I want to make a web application where people can fill in a form. I want to connect over the internet to a remote PC where Pervasive.SQL V8.7 is running, and put the data of the form into the database. I also want to be able to read from the database and return this info to my web application, so I can show it on a page.

    I hoped to put XML on the machine where Pervasive is running. But I think it is not possible.

    Can I use ODBC to connect to a remote machine too?

    I'm am sorry again for this stupid question for I am normally not working with databases or ODBC or remote computers

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Check out the white paper at http://www.pervasive.com/documentati...plications.pdf.
    It'll help.
    THe short answer to your question, it is possible to use ODBC to connect to a remote machine.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Jan 2007
    Posts
    12
    Thank you for your answer. I will properly read the document, I have just viewed it shortly now. It comes to my attention it is always ASP or .NET, while I work in PHP. I would like to know if it is possible in PHP for me, as I am a normal web devloper and not guru, and not all technical English text is clear to me.

    If you think, it is impossible or very hard in PHP, I think about other options but I prefer PHP.

    Thank you for your time,

    Chiman

  4. #4
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    PHP is an option. Once you have an ODBC DSN for your data, standard PHP ODBC functions will work.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  5. #5
    Join Date
    Jan 2007
    Posts
    12
    Thank you for you answer, mirtheil. I have been speaking to a colleague who thinks it is not possible to write to the Pervasive database with ODBC. He says the best solution, is to make an application that will convert between Pervasive and my web application. Maybe a Pervasive<->XML<->Pervasive translation, made in VB or Delphi, so that this Windows application can talk to my website using XML files that I transfer with FTP.

    I just wish there was an example where a PHP script does a easy query on a remote Pervasive database!

    But I thank you for your help so far!

  6. #6
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    If you have an ODBC Driver for your Btrieve databse, you can use this as an example (from my DataXtraction software):
    Code:
    <html>
    <head>
    <title>Report Title</title>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <META NAME="Author" CONTENT="Mirtheil Software">
    </head>
    <body>
    <h1>Report Title</h1>
    <?php
    $conn=odbc_connect("DEMODATA","","");
    $rs=odbc_exec($conn,"select * from class");
    echo "<table border=1>\n";
    $numfields = odbc_num_fields($rs);
    for($i=1;$i<=$numfields;$i++){
    	$fn=odbc_field_name($rs,$i);
    	echo "<th>$fn</th>";
    }
    echo "\n";
    while(odbc_fetch_row($rs)){
    	echo "<tr>\n";
    	for($i=1;$i<=$numfields;$i++){
    	$fv=odbc_result($rs,$i);
    	echo "<td>$fv</td>"; 
    }
    echo "</tr>\n";
    }
    echo "</table>\n";
    echo "<p>Number of Fields: $numfields</p>\n";
    ?>
    <small>Copyright &copy; 2002 - 2006. <a href="http://www.mirtheil.com">Mirtheil Software</a>. All Rights Reserved.<br>
    Page created using DataXtraction on 1/25/2007 10:34:49 AM.</small>
    </body>
    </html>
    This will pull the data from an ODBC Data Source called "demodata" and issue a "select * from class" SQL statement.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  7. #7
    Join Date
    Jan 2007
    Posts
    12
    Thank you for the reply. I will be testing this after the weekend, when I can continue on the project. Many thanks for all the advice!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •