Re: Updating record in an Access 2000 db using ADO

From: Val Mazur (group51a_at_hotmail.com)
Date: 05/26/04


Date: Tue, 25 May 2004 21:09:09 -0400

Hi,

I do not think first query would be a valid one. What is your full code,
which executes this query and what are you trying to achieve here?

-- 
Val Mazur
Microsoft MVP
"MADMAX" <anonymous@discussions.microsoft.com> wrote in message 
news:A5557D49-0C10-47BA-941B-809B91383A7C@microsoft.com...
> Hi guys,
>
> I'm trying to update a record in a Access database. The db is opened via 
> an UDL file.
>    [oledb]
>    ; Everything after this line is an OLE DB initstring
>    Provider=Microsoft.Jet.OLEDB.4.0;Data 
> Source=C:\TestDB.mdb;Mode=ReadWrite;Persist Security Info=False
>
> I'm using a command object with text command (adCmdText)
>
> strSQL="Parameters [Logname] Text, [UserPassword] Text, [Name] Text; " & _
>           "UPDATE Users SET USERPASSWORD = [UserPassword], NAME = [Name] " 
> & _
>           "WHERE LOGNAME = [Logname] ;"
>
> and if I use parameters I got the following message:
>   "Operation must use an updateable query."
>
> All goes fine if  I don't use parameters:
> strSQL = "UPDATE Users SET USERPASSWORD = '" & Password & "' , NAME = '" & 
> name & "' " & _
>              "WHERE LOGNAME = '" & logname & "' ;"
>
> What's going on ? I would like to use parameters since they guarantee a 
> better control on input.
>
> How good is the Jet Provider ? Things that worked smoth with SQLServer or 
> Oracle, are forcing
> me to dig into MSDN to make them work...
>
> THX for your kind reply.
>
> Max 


Relevant Pages

  • Re: Provider error 80020005 Type mismatch.
    ... publications, and many publications could have numerous authors. ... congratulations for using a saved parameter query rather than ... Dim PIpk, varTitle, varCitation, varProdType, varYear, varReview, ... there is never a need to use an explicit Command object. ...
    (microsoft.public.data.ado)
  • Re: Inserting Records Into Access Table via DAO
    ... > I'm used to using the command object in ADO to insert records into an SQL ... Another way is to use the RunSQL command object. ... Dim iIntVal as integer ... The downside is that the query will not be optimized. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Parameter Object really necessary?
    ... possible SQL injection attacks etc... ... you develop your query to include the parameters like this? ... Then run it through the command object? ... I'm still learning about .NET and it's one of those things that ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: UPDATE query in ASP.NET
    ... I don't see any association of your Command object to the Connection in your ... > Using Query Builder, I wrote a simple UPDATE query to update a single ... > Query Builder in a OleDbCommand object by right-clicking the mouse. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: cant get query to run over ADO, but works fine in Access interfac
    ... If an SQL statement runs in Query Analyzer (or some other interface), ... should be able to execute it using an ADO Command object. ...
    (microsoft.public.data.ado)