how to reference feild data -
- From: "barret bonden" <arthur@xxxxxxxxxxxxxxx>
- Date: Mon, 2 Jan 2006 16:11:01 -0500
Playing about in VB.NET using classic ADO and I cant see how to reference
feild data - the !fieldname
syntax I'm used to in Access doesn't seem to work -
Imports System.Data
Imports ADODB
Imports System.Data.OleDb
Dim conn As New ADODB.Connection
Dim rs As ADODB.Recordset
Dim v As String, i As Int16
conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\t.mdb")
rs = conn.Execute("select * from main")
rs.MoveFirst()
Do While Not rs.EOF
' ListBox1.Items.Add(rs!last) ' DOES NOT WORK
rs.MoveNext()
Loop
For i = 0 To rs.Fields.Count - 1
' ListBox1.Items.Add(rs.Fields(i).Name)
'ListBox1.Items.Add(rs.Fields(i).Name)
Next
.
- Follow-Ups:
- Re: how to reference feild data -
- From: Richard Mueller
- Re: how to reference feild data -
- Prev by Date: Best DB access
- Next by Date: Re: WriteXML
- Previous by thread: Best DB access
- Next by thread: Re: how to reference feild data -
- Index(es):
Relevant Pages
- RE: Import into Access from Excel, passing a variable for the field...
... there is a FieldName property in Access. ... rstMyRecordset.Fields!‘by
actual name, bang syntax, no quotation ... Try the parenthesis/quotation use of
the field name instead, or, if your ... Dim FieldName As String ... (microsoft.public.excel.worksheet.functions) - Re: Inserting rows syntax + row #ing code in protected sheet?
... mentioned WP above because I'm going to reference a handy piece of syntax I ...
is there is an extra command to handle "cancel" in VB? ... > Dim i As Long ...
> Exit Sub ... (microsoft.public.excel.programming) - Re: Using query values for field name in table
... You didn't need to change the syntax on the Fields collection to get it to ...
See http://www.QBuilt.com for all your database needs. ... >>> Dim dbsGeneralThoracic
As Database ... >>> Dim fOpenedDB As Boolean ... (microsoft.public.access.modulesdaovba) - Re: FTS Weighted Values Implementation Problem
... The syntax error comes from the simple quotes surrounding your search phrase. ...
Dim SearchTerm1 As String ... Dim conn As New SqlConnection ... (microsoft.public.sqlserver.fulltext) - Re: Programming for all fields in a table
... If you want to loop thorugh all records anyway, the syntax would be like ...
Dim rs As DAO.Recordset ... rather than allenbrowne at mvps dot org. ...
thank you (you must be an extremely experience programmer ... (comp.databases.ms-access)