Re: Access VBA update recordset error
From: Brendan Reynolds (brenreyn)
Date: 10/29/04
- Next message: Anushi \(Grapecity\): "Re: Performance comparison on Update vs. UpdateBatch - record by record"
- Previous message: NIL: "RE: How to Write into Excel"
- In reply to: cityofgp: "Re: Access VBA update recordset error"
- Next in thread: cityofgp: "Re: Access VBA update recordset error"
- Reply: cityofgp: "Re: Access VBA update recordset error"
- Messages sorted by: [ date ] [ thread ]
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. >> > >> >> >>
- Next message: Anushi \(Grapecity\): "Re: Performance comparison on Update vs. UpdateBatch - record by record"
- Previous message: NIL: "RE: How to Write into Excel"
- In reply to: cityofgp: "Re: Access VBA update recordset error"
- Next in thread: cityofgp: "Re: Access VBA update recordset error"
- Reply: cityofgp: "Re: Access VBA update recordset error"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|