Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - ADO General
Forum to discuss ADO specific questions for use with SalesLogix. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to ADO General | New ThreadView:  Search:  
 Author  Thread: ADODB.Fields
Fernando Dominguez
Posts: 4
 
ADODB.FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 May 08 1:22 PM
Does any one know why SLX cant create ADODB.Fields using the create object method or maybe I am missing a component.

Or better yet does anyone know a quick way to loop through column names on a recordset

thanks
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: ADODB.FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 May 08 2:29 PM
DIM I, theValue
WHILE NOT (rs.EOF)
For I = 0 to rs.Fields.Count - 1

TheValue = rs.FIELDS(i).VALUE
NEXT
rs.MOVENEXT
WEND

[Reply][Quote]
Fernando Dominguez
Posts: 4
 
Re: ADODB.FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 May 08 3:18 PM
this code will bet the the values of the column, i am interested on the ColumnName i.e.

select firstname, lastname, company from sometable

I was trying to do thid

Dim Fld, ColumnName
set fld = createobject("ADODB.Field")
for each fld in rs.fields
ColumnName = fld.Name
Next

but for some reason SLX cant create an ADODB.field
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: ADODB.FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 May 08 4:27 PM
You *don't* need to use CreateObject to create a ADODB.Field if you're already going to be getting the reference assigned elsewhere. In your code your fld variable will reference the field as set by the enumerator for the loop. All you need is to just do this:

Dim fld

For Each fld in rs.Fields
MsgBox fld.Name
Next


Get the idea?
[Reply][Quote]
Fernando Dominguez
Posts: 4
 
Re: ADODB.FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 May 08 6:08 PM
Thx...I found an article about that as well, I got my loop working using the actual recordset object looping through the field collection since I was comparing column names with an array

For i=0 To rsExcel.Fields.Count -1
msgbox rsExcel.Fields(i).Name
Next
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/26/2024 3:58:55 AM