TLowder
Programmer
- Mar 20, 2002
- 224
Hello,
I get an error on the adorec.update line - Unknown column 'MyName' in 'field list'. The code will work for read access but won't let me write to it. How do I update a field with an alias?
I know i can lose the "AS" part but that would defeat the purpose of what I'm accually trying to do. This is just a sample.
Thanks,
Tom
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim sql As String
Dim adocon As ADODB.Connection
Dim adorec As Recordset
Set adocon = New ADODB.Connection
Set adorec = New ADODB.Recordset
adorec.CursorLocation = adUseClient
adocon.ConnectionString = gConnectionString
adocon.Open
sql = "SELECT BanquetItemsTbl.Name as MyName FROM BanquetItemsTbl"
adorec.Open sql, adocon, adOpenDynamic, adLockOptimistic
adorec.AddNew
adorec!MyName = "TestName"
adorec.Update
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
I get an error on the adorec.update line - Unknown column 'MyName' in 'field list'. The code will work for read access but won't let me write to it. How do I update a field with an alias?
I know i can lose the "AS" part but that would defeat the purpose of what I'm accually trying to do. This is just a sample.
Thanks,
Tom
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim sql As String
Dim adocon As ADODB.Connection
Dim adorec As Recordset
Set adocon = New ADODB.Connection
Set adorec = New ADODB.Recordset
adorec.CursorLocation = adUseClient
adocon.ConnectionString = gConnectionString
adocon.Open
sql = "SELECT BanquetItemsTbl.Name as MyName FROM BanquetItemsTbl"
adorec.Open sql, adocon, adOpenDynamic, adLockOptimistic
adorec.AddNew
adorec!MyName = "TestName"
adorec.Update
''''''''''''''''''''''''''''''''''''''''''''''''''''''''