p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: ADO problems


Message #1 by "Peter Kaufman" <kaufman@l...> on Sun, 14 Apr 2002 08:27:40 +0700
Hi Folks,

I need some advice on the following:

1) Using this code, the recordset is apparently not opening as the
attempt to print a field returns 'object' and, yes, the table definitely
has records. I don't know why its not working. Trusted connection should
not be a problem - it works in SQL Query Analyzer. The connection string
is also shown below.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
$dbc = new com("ADODB.Connection");
$dbc->open("DSN=resume_be;");
print($dbc->connectionstring);
$strsql = "select * from tblContact";
$rs = $dbc->execute("select * from tblContact");
print $rs->recordcount
?>
</body>
</html>

Provider=MSDASQL.1;Extended
Properties="DSN=resume_be;UID=;WSID=ATHELON;DATABASE=resume_be;Trusted_C
onnection=Yes"

2) I am working from the PHP Black Book, which has no info on connecting
to anything but ODBC, MySQL and the like - not MS SQL or ADO. Can anyone
point me to a tutorial on using ADO with PHP?

Thanks a lot,

Peter



  Return to Index