Re: Access VBA update recordset error
From: cityofgp (cityofgp_at_discussions.microsoft.com)
Date: 10/29/04
- Next message: Brendan Reynolds: "Re: Access VBA update recordset error"
- Previous message: Anushi \(Grapecity\): "Re: Performance comparison on Update vs. UpdateBatch - record by record"
- In reply to: Brendan Reynolds: "Re: Access VBA update recordset error"
- Next in thread: Brendan Reynolds: "Re: Access VBA update recordset error"
- Reply: Brendan Reynolds: "Re: Access VBA update recordset error"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 29 Oct 2004 07:44:04 -0700
Here is the code that executes on the 'onclick' event.
You will notice I have commented the fieldnames that have spaces because
when I uncomment, I get the error message.
Dim rs As ADODB.Recordset
Dim dbconn As ADODB.Connection
Dim rate As Integer
Dim amount As Integer
Set dbconn = New ADODB.Connection
dbconn.ConnectionString = "DSN=BRZ;"
dbconn.Open
Set rs = New ADODB.Recordset
With rs
.Open "tblbrzaccounts", dbconn, , adLockOptimistic
.AddNew
!ROLL = txtRoll
!ReferenceRoll = txtRollRef
!LOCCD = txtLOCCD
!BLDNO = txtBLDNO
!UNIT = UNIT
!TENANT = txtTenant
![BusinessAddress] = txtAddress
'![Bus PC] = txtPC
!TenantName = txtTenantName
!BusinessName = txtBusName
!MailingAddress1 = txtMailAdd1
!MailingAddress2 = txtMailAdd2
!City = txtCity
!Prov = txtProv
!MailingPC = txtBillPC
!Country = txtBillCountry
!BUSPHONE = txtWork
!BusinessRepName = txtBusRepName
!LessorsName = txtLessor
!LSSRPHONE = txtPhone
!Comments = txtComments
!CHANGESystem = txtChanges
!Start = txtStart
!End = txtEnd
'![Tentan TypeCode] = txtTenTypeCode
!Size = txtSize
!AssessmentCode = txtAssessmentCode
!BusinessType = txtBusType
'![Tax Status] = txtTaxStatus
'![Millrate Code] = txtMillrateCode
'![Current Assmt] = txtCurrentAssmt
![2003TaxPrevAsmt] = txt2003PrevAssmt
!Status = txtStatus
'![Drive Code] = CStr(txtLOCCD & "-" & txtBLDNO & txtUnit & txtTenant)
.Update
End With
rs.Close
dbconn.Close
MsgBox "saved"
"Brendan Reynolds" wrote:
> 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.
- Next message: Brendan Reynolds: "Re: Access VBA update recordset error"
- Previous message: Anushi \(Grapecity\): "Re: Performance comparison on Update vs. UpdateBatch - record by record"
- In reply to: Brendan Reynolds: "Re: Access VBA update recordset error"
- Next in thread: Brendan Reynolds: "Re: Access VBA update recordset error"
- Reply: Brendan Reynolds: "Re: Access VBA update recordset error"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|