returning the field names

Results 1 to 3 of 3

Thread: returning the field names

  1. #1
    Join Date
    Dec 1969

    Default returning the field names

    Hi.<BR><BR>I have a SQL Query "Select * from [Table Name]" .I would like to retreive the column names using ADO. Could anyone please help me out.<BR><BR>Thanks in advance<BR>George

  2. #2
    Bin Guest

    Default RE: returning the field names

    The solution is <BR><BR>dim cnn As ADODB.Connection<BR>Dim rec As ADODB.Recordset<BR>Set cnn = New ADODB.Connection<BR>Set rec = New ADODB.Recordset<BR> <BR>cnn.ConnectionString "MyConnect"<BR>cnn.Open<BR> <BR>rec.Open "MySQL", cnn, adOpenDynamic, adLockOptimistic<BR> msgobx rec.Fields.Item(i).Name <BR> <BR>Use the fields collection to Iterate through the collection and get the name

  3. #3
    kalyancp Guest

    Default RE: returning the field names

    try this<BR>this should be <BR>record.fields(i).name<BR><BR>you should get it<BR>kalyancp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts