runtime error 3144 on one pc, but not on other?

daniel.dzc

New member
Local time
Today, 00:39
Joined
Dec 13, 2008
Messages
4
Hi.
I have written small access form with few update statements. On the pc i have written it on it is working no problem, on other pc it is not. Here is where i am getting runtime error 3144:

db.Execute "UPDATE MEMBER SET Prio=" & Prio & " WHERE Nick='" & nick & "'"

Prio is integer, therefore it is not in ' ' , nick is a string so i put it in ' ' marks.
I have checked all fields names in my table, everything schould be ok. Like I said I have checked it on 4 pc's, 2 of them are running it ok, on 2 i have that error....
 
Revise you code to store the whole string in a variable

Dim SSql As String

SSql = "UPDATE MEMBER SET Prio=" & Prio & " WHERE Nick='" & nick & "'"

Next send it to the immediate window

Debug.Print SSql

Copy the string to the buffer (Ctrl+C)

Create a new query and replace the sql statement with the above and change view to design mode. If there is an error it will detect it and attempt to point you to the position in the string where the error occurs.

David
 
UPDATE MEMBER SET Prio=100 WHERE Nick='Daniel'

Thats what I get. Still the same problem. When I create a query manually in access and paste that query there, then try to run it it works. But from vba platform still not:/

But still- why would it run on one pc and not on the other?
 
what IS error 3144?

also, i would add extra spaces around the = signs just in case - sql can be fussy about things like that - although if it was just syntax, it should fail every time
 
Definition of Error 3144

3144 - Syntax error in UPDATE statement

I also remember reading something in this forum about the need for the spaces
 
Yep- i have that syntax error on 2 psc, on other 2 i don't. Can that be caused by version of sql server or something? They don't change syntax too often i guess o.O
 
so put extra spaces in, and make it

db.Execute "UPDATE MEMBER SET Prio = " & Prio & " WHERE Nick = '" & nick & "'"

see if that stops the errors

-------
as i say, i ALWAYS put extra spaces in these things.
 

Users who are viewing this thread

Back
Top Bottom