If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Web application reading/writing to Pervasive database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-25-07, 06:37
jmpfffc jmpfffc is offline
Registered User
 
Join Date: Jan 2007
Posts: 12
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
Reply With Quote
  #2 (permalink)  
Old 01-25-07, 07:17
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #3 (permalink)  
Old 01-25-07, 07:36
jmpfffc jmpfffc is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 01-25-07, 08:33
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #5 (permalink)  
Old 01-25-07, 09:49
jmpfffc jmpfffc is offline
Registered User
 
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!
Reply With Quote
  #6 (permalink)  
Old 01-25-07, 11:36
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #7 (permalink)  
Old 01-26-07, 03:11
jmpfffc jmpfffc is offline
Registered User
 
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!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On