Jump to content

Archived

This topic is now archived and is closed to further replies.

mrmoz

ODBC error

Recommended Posts

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 advance

Moz!

// 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");

Share this post


Link to post
Share on other sites
I'm guessing that Perfdesc is a character field so $perfd needs to be quoted

[code]$conn -> execute("UPDATE Perfumes
SET Perfdesc = '$perfd'
WHERE ID = $number");[/code]

PS Access doesn't have LIMIT.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.