Switch Code from Accessing SQL Server to Access Database
Posted: Fri Aug 22, 2008 11:49 am
I have this code that is access a SQL server. I need to change it to go after an access database.
I am very green to this and would appreciate any help I can get.
Thoughts, examples?
THANKS in advance
I am very green to this and would appreciate any help I can get.
Thoughts, examples?
THANKS in advance
Code: Select all
$p_num = @$_GET["id"];
$image_type = @$_GET["type"];
$myServer = "LO-.LOG.ORG\FF,5502";
$myUser = "GIS";
$myPass = "GIS";
$myDB = "PDSD";
$conn = new COM ("ADODB.Connection")or die("Cannot start ADO");
$connStr = "PROVIDER=SQLOLEDB;SERVER=".$myServer.";UID=".$myUser.";PWD=".$myPass.";DATABASE=".$myDB;
$conn->open($connStr);
$sql_str = "SELECT * FROM PHOTOS WHERE PID = '".$p_num."' AND Photo_Doc = 'P'";
$photo_rs = $conn->execute($sql_str);
echo "<div class='redbg'> <b><big>Assessing Photos:</big></b></div>";
echo "<br>";
If ($photo_rs->EOF)
{
echo "No photos exist for this parcel!";
} else
{
$photo_rs->MoveFirst();
echo "<table border='2' width='100%'>";
While (!$photo_rs->EOF)
{
$p_name = $photo_rs->Fields("Filename")->Value;
$p_hype = "javascript:window.open('file://S:/GeoImag/Assessing/Photos/".$p_name."','photowindow','width=450,height=350',position='Center')";
writelinewhype($p_name,"Image",$p_hype);
$photo_rs->MoveNext();
}
echo "</table>";
$photo_rs->Close();
$photo_rs = null;
}