Jump to content


How to handle sql errors?

  • Please log in to reply
No replies to this topic

#1 zeus68

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 December 2005 - 11:49 PM

I use this code to connect to my access database that's sat on a XP machine (no sql server) it's a dsn-less connection
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=dvd.mdb");

//$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db");
$rs = $conn->Execute("SELECT * FROM dvd WHERE title LIKE '%$title%' ORDER BY title");

I need to display something like "no movies found" if the search aql query returns no fields.

For some reason some of the sql statements don't seem to work. i.e. if I add above to the sql query the TOP 10 next to the select statement it works fine but if I also add START 10,10 doesn't

Any ideas?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users