PSS ID Number: 223771
Article Last Modified on 8/23/2001
Dim rst As New ADODB.Recordset
rst.Fields.Append "xx1", adInteger
rst.Fields.Append "xx2", adChar, 5
rst.Open
For Each ofld In rst.Fields
Debug.Print ofld.Name
Next
Dim rst As New ADODB.Recordset
rst.Open "SHAPE {SELECT author FROM authors}" & _
"APPEND NEW adChar(10) NewCol1, NEW adChar(10) NewCol2", _
"Provider=MSDATASHAPE" & _
";Data Provider=MSDASQL" & _
";Data Source=<your_dsn>" & _
";User ID=;Password=;", _
adOpenStatic, adLockBatchOptimistic
For Each ofld In rst.Fields
Debug.Print ofld.Name
Next
rst.AddNew Array("author", "NewCol1", "NewCol2"), _
Array("Detroit", "string1", "string2")
rst.MoveFirst
While rst.EOF <> True
Debug.Print rst!author, rst!NewCol1, rst!NewCol2
rst.MoveNext
Wend
Dim rst As New ADODB.Recordset
rst.Open "SELECT * FROM authors", _
"Provider=MSDASQL;Data Source=<your_dsn>;User ID=;Password=;", _
adOpenStatic, adLockBatchOptimistic
rst.Fields.Append "xx1", adInteger
Additional query words: column
Keywords: kbDatabase kbDSupport kberrmsg kbprb KB223771
Technology: kbADO200 kbADO201 kbADO210 kbADO250 kbADO260 kbADO270 kbADOsearch kbAudDeveloper