Re: Access and GUID Column Type



Dennis wrote:
> "UPDATE Items SET Title='new title' WHERE KeyID= '" & myGUID.ToString
> & "'"
>
> I don't get an error, it just doesn't update the record. The WHERE
> clauses in the SQL's are exactly the same. Why does Select work and
> Update doesn't?

I can't see anything obviously wrong with that statement. Are you sure the
GUID isn't being re-generated? Perhaps you could assign the SQL statement to
a string variable and Debug.WriteLine() it just to be completely sure, then
execute the SQL in the string.

Are you using a SQL Server database? If so you could try these:

- execute the statement that is returned by the Debug.WriteLine() in Query
Analyzer. This will tell you how many records were updated. This will
discount ADO.NET problems.

- run SQL Profiler to see exactly what query was executed.

Hopefully one of these will track down the problem.

--

(O) e n o n e


.



Relevant Pages

  • Re: creating and executing queries in VBA.
    ... Execute it into what? ... You can't just "execute" a select query. ... When you execute sql it has to go into a report, or a form or a record set. ...
    (microsoft.public.access.modulesdaovba)
  • Re: UPDATE query in Access 2003 raising error
    ... Runtime error 3066 Query must have at least one destination field. ... The SQL works fine if I use it in the QBF Design mode. ... Set qdfTemp = db.CreateQueryDef ... Elsewhere in the code I use the same technique to execute an SQL ...
    (microsoft.public.access.formscoding)
  • Re: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT I
    ... This statement causes ADO to create a recordset to receive the results ... of the query being executed and assign that recordset to your qryAddProj ... You should use the ExecuteOptions argument of the Execute ... string containing a sql statement to be executed. ...
    (microsoft.public.data.ado)
  • Re: ADO.NET query execution much slower than SQL Management Studio
    ... A stored procedure uses a query plan that's created when the SP is first executed and reuses that plan regardless of the suitability of the plan from that point forward--until it's replaced. ... Something that would affect the .NET SqlClient but not SQL Mgmt Studio? ... takes less than one second to execute. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: UPDATE query in Access 2003 raising error
    ... Doug Steele, Microsoft Access MVP ... Runtime error 3066 Query must have at least one destination field. ... The SQL works fine if I use it in the QBF Design mode. ... Elsewhere in the code I use the same technique to execute an SQL ...
    (microsoft.public.access.formscoding)