JavaScript to PHP to Access Database Connection

JS to PHP to access database connection? connecting help

Page 1 of 1

1 Replies - 6486 Views - Last Post: 07 April 2009 - 07:49 PM Rate Topic: -----

#1 XMEGA  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 135
  • Joined: 17-November 08

JavaScript to PHP to Access Database Connection

Posted 07 April 2009 - 07:48 PM

so I have a form page with basic validations (ID, firstName, lastName, address, phone# ect...) for fields.
once the data is correctly entered and no errors it goes to a php page which prints the fields entered just for display purposes then trys to connect to an access database.
the problem...
the already created access database has some information in it already however what was entered just now should also be added to the existing database
using the following in php...

<?php
	$vendorID = $_POST["vendorID"];
	$itemDescription = $_POST["itemDescription"];
	$cost = $_POST["cost"];
	
	print ("<br> Vendor ID: $vendorID");
	print ("<br> Item Description: $itemDescription");
	print ("<br> Cost: $$cost");
	
	print 'This is a Test txt'; $conn=odbc_connect('MyAccess','',''); 
 
	//Provider=Microsoft.ACE.OLEDB.12.0;DataSource=C:\Users\dpelerin\Desktop\TEST1.accdb;Persist Security Info=False; 

	// Microsoft Access connection string. 
	//$conn->Open("DRIVER={Microsoft Access Driver (*.accdb)}; DBQ=C:\inetpub\wwwroot\PshincNew2"); 
	$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data  Source=D:\\Program Files\xampplite\htdocs\databasefile.accdb"); 
	
	$db="D:\\Program Files\xampplite\htdocs\databasefile.accdb");
	$conn = new COM('ADODB.Connection');
	
	$conn->Open("Provider=Microsoft.ACE.OLEDB.12.0;DataSource=$db;"):
?>




Is This A Good Question/Topic? 0
  • +

Replies To: JavaScript to PHP to Access Database Connection

#2 XMEGA  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 135
  • Joined: 17-November 08

Re: JavaScript to PHP to Access Database Connection

Posted 07 April 2009 - 07:49 PM

so I have a form page with basic validations (ID, firstName, lastName, address, phone# ect...) for fields.
once the data is correctly entered and no errors it goes to a php page which prints the fields entered just for display purposes then trys to connect to an access database.
the problem...
the already created access database has some information in it already however what was entered just now should also be added to the existing database
using the following in php...

<?php
	$vendorID = $_POST["vendorID"];
	$itemDescription = $_POST["itemDescription"];
	$cost = $_POST["cost"];
	
	print ("<br> Vendor ID: $vendorID");
	print ("<br> Item Description: $itemDescription");
	print ("<br> Cost: $$cost");
	
	print 'This is a Test txt'; $conn=odbc_connect('MyAccess','',''); 
 
	//Provider=Microsoft.ACE.OLEDB.12.0;DataSource=C:\Users\dpelerin\Desktop\TEST1.accdb;Persist Security Info=False; 

	// Microsoft Access connection string. 
	//$conn->Open("DRIVER={Microsoft Access Driver (*.accdb)}; DBQ=C:\inetpub\wwwroot\PshincNew2"); 
	$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data  Source=D:\\Program Files\xampplite\htdocs\databasefile.accdb"); 
	
	$db="D:\\Program Files\xampplite\htdocs\databasefile.accdb");
	$conn = new COM('ADODB.Connection');
	
	$conn->Open("Provider=Microsoft.ACE.OLEDB.12.0;DataSource=$db;"):
?>



Was This Post Helpful? 0
  • +
  • -

Page 1 of 1