mrmoz Posted March 24, 2006 Share Posted March 24, 2006 HI I'm being forced to use Access 2003 instead of MySQL and ma having loads of problems I am unable to create an ODBC connection so I have to do it all in the code. The mani problem I'm having at the moment seems incredibably simple but I can't figure it out. I keep on getting a syntax error for the below code can anybody help?Thanks in advanceMoz!// Microsoft Access connection string$conn=new COM("ADODB.Connection") or die("Cannot start ADO"); $conn-> open("Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Jet OLEDB:Database Password=o***;Data Source=***;");$conn -> execute("UPDATE Perfumes SET Perfdesc=$perfd WHERE ID=$number LIMIT 1"); Quote Link to comment Share on other sites More sharing options...
Barand Posted March 24, 2006 Share Posted March 24, 2006 I'm guessing that Perfdesc is a character field so $perfd needs to be quoted[code]$conn -> execute("UPDATE PerfumesSET Perfdesc = '$perfd'WHERE ID = $number");[/code]PS Access doesn't have LIMIT. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.