C
cityofgp
Using the recordset object, and a connetion object, I can connect to a
database and add records, howevere where the fieldname has spaces, I am
unable to update.
Following is the code I am using in the onclick event
You will notice I have commented out the field names that have spaces as
that generates a syntax error...
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.
Is there a way I can update those columns that have spaces in the fieldnames?
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"
database and add records, howevere where the fieldname has spaces, I am
unable to update.
Following is the code I am using in the onclick event
You will notice I have commented out the field names that have spaces as
that generates a syntax error...
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.
Is there a way I can update those columns that have spaces in the fieldnames?
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"