PC Review


Reply
Thread Tools Rate Thread

Can't Update Database

 
 
Anthony Ching
Guest
Posts: n/a
 
      8th Jan 2010
I am using Access 2007. I have the following coding for updating the password
field of the user table:

Dim rst As New ADODB.Recordset, Sql As String
Dim cn As ADODB.Connection

Set cn = CurrentProject.Connection
Sql = "UPDATE [User Identification] SET [Password] = '" &
TempVars!NewPassword & "', [Date Last Change] = '" & Now() & "' WHERE [User
ID]= '" & TempVars!CurrentUser & "';"

rst.Open Sql, cn
Set rst = Nothing

The data has been split and reside on a remote server. I have generated the
run-time codes using Access Developer and have Access Run-time on the
machines. However, while this works fine on my development machine (which has
Office 2007), it doesn't work on other machines (with Office 2003) who are
also connected to the server. The error number is "-2147467259" and the error
description is "Operation must be an updateable query". Can someone help.
--
Anthony
 
Reply With Quote
 
 
 
 
Tom van Stiphout
Guest
Posts: n/a
 
      8th Jan 2010
On Thu, 7 Jan 2010 18:33:01 -0800, Anthony Ching
<(E-Mail Removed)> wrote:

There are a few unusual things about this update statement, but I'm
not sure they can explain that behavior.
I am assuming [User Identification] is a table, not a query?
Does it have a Primary Key?
Now() should be wrapped in #-signs rather than single-quotes.
Do you really have an alphanumeric UserID?
Also when the error occurs inspect the values to see if they are what
you expected.

-Tom.
Microsoft Access MVP



>I am using Access 2007. I have the following coding for updating the password
>field of the user table:
>
> Dim rst As New ADODB.Recordset, Sql As String
> Dim cn As ADODB.Connection
>
> Set cn = CurrentProject.Connection
> Sql = "UPDATE [User Identification] SET [Password] = '" &
>TempVars!NewPassword & "', [Date Last Change] = '" & Now() & "' WHERE [User
>ID]= '" & TempVars!CurrentUser & "';"
>
> rst.Open Sql, cn
> Set rst = Nothing
>
>The data has been split and reside on a remote server. I have generated the
>run-time codes using Access Developer and have Access Run-time on the
>machines. However, while this works fine on my development machine (which has
>Office 2007), it doesn't work on other machines (with Office 2003) who are
>also connected to the server. The error number is "-2147467259" and the error
>description is "Operation must be an updateable query". Can someone help.

 
Reply With Quote
 
Anthony Ching
Guest
Posts: n/a
 
      11th Jan 2010
[User Idntification] is a table with primary key [User ID] which is
alphanumeric.
--
Anthony


"Tom van Stiphout" wrote:

> On Thu, 7 Jan 2010 18:33:01 -0800, Anthony Ching
> <(E-Mail Removed)> wrote:
>
> There are a few unusual things about this update statement, but I'm
> not sure they can explain that behavior.
> I am assuming [User Identification] is a table, not a query?
> Does it have a Primary Key?
> Now() should be wrapped in #-signs rather than single-quotes.
> Do you really have an alphanumeric UserID?
> Also when the error occurs inspect the values to see if they are what
> you expected.
>
> -Tom.
> Microsoft Access MVP
>
>
>
> >I am using Access 2007. I have the following coding for updating the password
> >field of the user table:
> >
> > Dim rst As New ADODB.Recordset, Sql As String
> > Dim cn As ADODB.Connection
> >
> > Set cn = CurrentProject.Connection
> > Sql = "UPDATE [User Identification] SET [Password] = '" &
> >TempVars!NewPassword & "', [Date Last Change] = '" & Now() & "' WHERE [User
> >ID]= '" & TempVars!CurrentUser & "';"
> >
> > rst.Open Sql, cn
> > Set rst = Nothing
> >
> >The data has been split and reside on a remote server. I have generated the
> >run-time codes using Access Developer and have Access Run-time on the
> >machines. However, while this works fine on my development machine (which has
> >Office 2007), it doesn't work on other machines (with Office 2003) who are
> >also connected to the server. The error number is "-2147467259" and the error
> >description is "Operation must be an updateable query". Can someone help.

> .
>

 
Reply With Quote
 
Anthony Ching
Guest
Posts: n/a
 
      11th Feb 2010
I changed the statement to
Sql = "UPDATE [User Identification] SET [Password] = '" & ([New Password]) &
"', [Date Last Change] = #" & Now() & "# WHERE [User ID]= '" &
TempVars!CurrentUser & "';"

I made a runtime version using Access Developer Extension and have included
Access Runtime with it. It is working fine on my own machine. However, when
this is set up on another machine the following error came up:

-2147467259 Operation must be an updateable query

The data of this program has been split and reside on a server.


--
Anthony


"Tom van Stiphout" wrote:

> On Thu, 7 Jan 2010 18:33:01 -0800, Anthony Ching
> <(E-Mail Removed)> wrote:
>
> There are a few unusual things about this update statement, but I'm
> not sure they can explain that behavior.
> I am assuming [User Identification] is a table, not a query?
> Does it have a Primary Key?
> Now() should be wrapped in #-signs rather than single-quotes.
> Do you really have an alphanumeric UserID?
> Also when the error occurs inspect the values to see if they are what
> you expected.
>
> -Tom.
> Microsoft Access MVP
>
>
>
> >I am using Access 2007. I have the following coding for updating the password
> >field of the user table:
> >
> > Dim rst As New ADODB.Recordset, Sql As String
> > Dim cn As ADODB.Connection
> >
> > Set cn = CurrentProject.Connection
> > Sql = "UPDATE [User Identification] SET [Password] = '" &
> >TempVars!NewPassword & "', [Date Last Change] = '" & Now() & "' WHERE [User
> >ID]= '" & TempVars!CurrentUser & "';"
> >
> > rst.Open Sql, cn
> > Set rst = Nothing
> >
> >The data has been split and reside on a remote server. I have generated the
> >run-time codes using Access Developer and have Access Run-time on the
> >machines. However, while this works fine on my development machine (which has
> >Office 2007), it doesn't work on other machines (with Office 2003) who are
> >also connected to the server. The error number is "-2147467259" and the error
> >description is "Operation must be an updateable query". Can someone help.

> .
>

 
Reply With Quote
 
Anthony Ching
Guest
Posts: n/a
 
      12th Feb 2010
I changed the coding to the following:

Dim strSql As String
Dim cn As ADODB.Connection

On Error GoTo Change_Err

Set cn = CurrentProject.Connection
strSql = "UPDATE [User Identification] SET [Password] = '" & ([New
Password]) & "', [Date Last Change] = #" & Now() & "# WHERE [User ID]= '" &
TempVars!CurrentUser & "';"

cn.Execute strSql

However, the same message came out.

--
Anthony


"AccessVandal via AccessMonster.com" wrote:

> Did my suggestion work?
>
> Your're openning a recordset with the command, you should use Execute.
>
> Anthony Ching wrote:
> >I changed the statement to
> >Sql = "UPDATE [User Identification] SET [Password] = '" & ([New Password]) &
> >"', [Date Last Change] = #" & Now() & "# WHERE [User ID]= '" &
> >TempVars!CurrentUser & "';"
> >
> >I made a runtime version using Access Developer Extension and have included
> >Access Runtime with it. It is working fine on my own machine. However, when
> >this is set up on another machine the following error came up:
> >
> >-2147467259 Operation must be an updateable query
> >
> >The data of this program has been split and reside on a server.

>
> --
> Please Rate the posting if helps you.
>
> Message posted via http://www.accessmonster.com
>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Excel Database via Access Main Database with a script Finnbar Microsoft Excel New Users 2 3rd Nov 2008 07:24 PM
Script to Update a Excel Database whenever a Access Database is mo Finnbar Microsoft Access 5 3rd Nov 2008 06:03 PM
Using Excel as a database and need macro or vba to take data entered on one tab and update the database by adding to the next avail row rjr Microsoft Excel Programming 5 11th Jun 2006 09:43 PM
DATA UPDATE FROM CLIENT SIDE DATABASE TO WEB-SERVER DATABASE http://www.visual-basic-data-mining.net/forum Microsoft Access 0 23rd Sep 2004 03:35 PM
Executing UPDATE SQL command doesnot update the database immediately. Venu Koduru Microsoft Access 1 8th Sep 2003 09:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:01 PM.