A few things.
1) Try executing the SQL string from the ACCESS Query generator. See if it works
2) What is the data type for field LOCKED? Did you try setting it to TRUE or -1
3) You don't need to Define a query, Just execute it directly,
Set dbs = CurrentDb
dbs.execute SQLString (in quotes)
set dbs = nothing
From: AccessDevelopers@yahoogroups.com [mailto:AccessDevelopers@yahoogroups.com] On Behalf Of visualbprogrammers@yahoo.com
Sent: Thursday, April 18, 2013 9:41 AM
To: accessdevelopers@yahoogroups.com
Subject: [AccessDevelopers] Error: 3125: is not a valid name. Make sure that it does not include....
Hello all: Could anyone help me with the following error I am getting when executing an UPDATE query? is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long. Here is the piece of code... .... sql = "UPDATE USER_TABLE " _ & "SET locked='Y' " _ & "WHERE APPUSER_NAME='" & strUserName & "' AND APPUSER_DOMAIN_NAME='" & strDomainName & "'" Debug.Print "SQL: " & sql Set dbs = CurrentDb Set qdf = dbs.CreateQueryDef(sql) qdf.Execute When copy to the SQL screen it seems to work find. Thanks, |
Tidak ada komentar:
Posting Komentar