Re: Access VBA update recordset error

From: Brendan Reynolds (brenreyn)
Date: 10/29/04


Date: Fri, 29 Oct 2004 11:37:42 +0100

I think we'll need to see the actual code to trouble-shoot this one. The
full text of the error message might help, too.

-- 
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com
The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
"cityofgp" <cityofgp@discussions.microsoft.com> wrote in message 
news:A04C5F06-CB90-4E43-AB6E-6822BDC8F3BC@microsoft.com...
>I am using the exact same syntax and it gives me a syntax error message 
>when
> it reaches the .update statement.
>
>
> "Brendan Reynolds" wrote:
>
>> I don't see anything obviously wrong with the example you posted, and the
>> test code below works for me. I prefer something like rst.Fields("Field
>> Name") myself, as it is a little more explicit, but ![Field Name] should
>> work, too. What error are you seeing?
>>
>> Public Sub TestUpdate()
>>
>>     Dim rst As ADODB.Recordset
>>     Set rst = New ADODB.Recordset
>>     With rst
>>         .ActiveConnection = CurrentProject.Connection
>>         .CursorLocation = adUseClient
>>         .CursorType = adOpenKeyset
>>         .LockType = adLockOptimistic
>>         .Open "SELECT * FROM tblTest"
>>         .AddNew
>>         ![Field Name With Spaces] = "Some Text"
>>         .Update
>>         .Close
>>     End With
>>
>> End Sub
>>
>> -- 
>> Brendan Reynolds (MVP)
>> http://brenreyn.blogspot.com
>>
>> The spammers and script-kiddies have succeeded in making it impossible 
>> for
>> me to use a real e-mail address in public newsgroups. E-mail replies to
>> this post will be deleted without being read. Any e-mail claiming to be
>> from brenreyn at indigo dot ie that is not digitally signed by me with a
>> GlobalSign digital certificate is a forgery and should be deleted without
>> being read. Follow-up questions should in general be posted to the
>> newsgroup, but if you have a good reason to send me e-mail, you'll find
>> a useable e-mail address at the URL above.
>>
>>
>> "cityofgp" <cityofgp@discussions.microsoft.com> wrote in message
>> news:FB8B3D87-5187-44A8-A150-4609ED660939@microsoft.com...
>> > Using ADODB.recordset and connection, I can successfully update records
>> > using:
>> >
>> > rs![field1] = "blah"
>> > rs.update
>> >
>> > However, when I have a field name with a space as follows:
>> >
>> > rs![field 1] = "blah"
>> > rs.update
>> >
>> > I get a syntax error message.
>> > How can I update fields that have spaces in the field name? What syntax 
>> > do
>> > I
>> > use?
>> >
>> > TIA.
>> >
>>
>>
>> 


Relevant Pages

  • Re: Error exiting database
    ... without error if you choose 'Compile ' form the Debug ... > The Load Event looks like this but I don't understand why it would fire ... >> The error message, though, indicates that the problem is in the Load ... >> GlobalSign digital certificate is a forgery and should be deleted without ...
    (microsoft.public.access.formscoding)
  • Re: Limits to long interger field
    ... me to use a real e-mail address in public newsgroups. ... GlobalSign digital certificate is a forgery and should be deleted without ... >I am receiving an error message telling me I have entered too long a number ...
    (microsoft.public.access.gettingstarted)
  • Re: How to add a type to a collection ??
    ... I just don't understand why I can't add a user-defined type to a collection. ... "Brendan Reynolds" wrote: ... >> I'm trying to add a type to a collection and am getting an error message I ... I know of no way to cut and paste a MS Access error message. ...
    (microsoft.public.access.gettingstarted)
  • Re: ADO find Date
    ... "Brendan Reynolds" wrote in message ... > and failed again when I tried it with the Find method of an ADO recordset. ... > The error message in the latter case was "Arguments are of the wrong type, ... > are out of acceptable range, or are in conflict with one another", as in ...
    (microsoft.public.access.modulesdaovba)
  • Re: ADO find Date
    ... and failed again when I tried it with the Find method of an ADO recordset. ... The error message in the latter case was "Arguments are of the wrong type, ... GlobalSign digital certificate is a forgery and should be deleted without ... > "DataDay" wrote in message ...
    (microsoft.public.access.modulesdaovba)