473,547 Members | 2,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Probleme sql UPDATE par odbc/php

Bonjour,

dans un script php je fais un odbc_exec($db_a pisoft, $sql)
la chaine sql est UPDATE client SET FacNom="BLOT JEAN-LOUI",
FacAdr="CHANTEG REL", FacCp="24120", FacVille="PAZAY AC", ModeReg="3",
Domiciliation=" TERRASSON", Etablissement=" 12406", Guichet="00016" ,
CompteBanque="0 0176950810", CleRib="23", FamilleClient=" 2" WHERE
Code="32103"

j'ai l'erreur suivante :
Warning: SQL error: [Microsoft][Pilote ODBC Microsoft Access] Trop peu
de paramètres. 6 attendu., SQL state 07001 in SQLExecDirect in
d:\program files\easyphp\w ww\test.php on line 73

alors que si j'execute cette requete sql directement dans access ça
fonctionne !

Merci de votre aide.

Denis.
Nov 12 '05 #1
2 4648
On 7 Oct 2003 06:47:44 -0700, po***********@l aposte.net (Denis) wrote:

On parlez Anglais ici.
Iterate over the Parameters collection to find out what's going on. Or
run the query interactively, and Access will tell you.
One thing I see as a problem is that you have double-quotes around
numeric values. That's why I don't believe your statement that you
executed the *exact* same query interactively.

-Tom.

Bonjour,

dans un script php je fais un odbc_exec($db_a pisoft, $sql)
la chaine sql est UPDATE client SET FacNom="BLOT JEAN-LOUI",
FacAdr="CHANTE GREL", FacCp="24120", FacVille="PAZAY AC", ModeReg="3",
Domiciliation= "TERRASSON" , Etablissement=" 12406", Guichet="00016" ,
CompteBanque=" 00176950810", CleRib="23", FamilleClient=" 2" WHERE
Code="32103"

j'ai l'erreur suivante :
Warning: SQL error: [Microsoft][Pilote ODBC Microsoft Access] Trop peu
de paramètres. 6 attendu., SQL state 07001 in SQLExecDirect in
d:\program files\easyphp\w ww\test.php on line 73

alors que si j'execute cette requete sql directement dans access ça
fonctionne !

Merci de votre aide.

Denis.


Nov 12 '05 #2
Hi and thank you for your answer,

sorry to wrote the post in french but it was published through google
and i thought it was french newsgroup.

i've found that i rather use simple quotes instead of doubles around
fields. And then make a php function to escape ' and " in the sql
statement.
Now it works fine.

Thx again.

Denis.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3016
by: grigoo | last post by:
bonjour a tous je me presente a vous::: greg dit le grigoo sur le web ,,etudiant en bioinformatique a montreal et jusqu au cou dans notre language prefere....java. et biojava.. et je suis en un newbee dans ce domaine et me dit que l homme est bien peu de chose voici en definitive mon probleme>>> je construit une classe appele...
0
5332
by: Jim S. | last post by:
I'm having a horrible time simply inserting the date in a MySQL database through a Visual Basic program. I have a table, called "ORDERS"; "ID" is the primary key. I'm trying the insert the date, into the MySQL database, which is a DATETIME datatype. I must keep it DATETIME so it can be accessed via Microsoft Access. Here are two versions of...
7
7294
by: kaming | last post by:
Dear all, I found that I can't update or delete a DB2 record with timestamp using Access through ODBC. The Access complains "No current record" while I attempt to update or delete the record with timestamp. Do anyone have idea of how to fix this problem? Thanks in advance!
0
2620
by: immergut | last post by:
Hallo! Als Projekt für meine Facharbeiterprüfung habe in das Problem XML-DTD's in Tabellenstruckturen für Access umzuwandeln. Input: XML-DTD Output: SQL-Datei Nun mein Problem:
2
3235
by: Mike | last post by:
I'm trying to update an existing record in an Access 2003 db and i'm getting the following error: The following error has occured ERROR Syntax error in UPDATE statement. at System.Data.Odbc.OdbcConnection.HandleError(HandleRef hrHandle, SQL_HANDLE hType, RETCODE retcode) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior...
1
1707
by: Sajid | last post by:
Hello! Experts, I have the following piece of code in VB.NET that I want to use to update any records in the database. I would like to use a code as well as DataGrid to update the records. Please guide me how can I achieve it. I know there is an Update command to to do this that but since I am a newbie I don't know how? I'll be really...
1
2517
by: cindy | last post by:
this is the call private void Page_Load(object sender, System.EventArgs e) { OdbcConnection connection = new OdbcConnection ("DSN=PFW52"); CreateDataAdapter(connection); } this is the code, no errors, but NO UPDATE I have to use ODBC I just need to update a field based on a key, EMBARASSED to say days going
2
4794
by: technocraze | last post by:
Hi guys, I have encountered this error when updating the values to the MS Acess table. Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and sql server is my backend server. This error occured whenever i step through and when it reaches rs.update it jux hangs down there and thereafter...
0
7510
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7703
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7463
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6032
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3493
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3473
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
748
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.