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!
|
|
SLX Field Types
Posted: 05 Sep 06 3:53 PM
|
fiogf49gjkf0d Does anyone know how to obtain the field types and lengths when I build a recordset from an SQL?
I need to compare the field type, string, integer, float... to fields in an external database. I could hard code all the field types, but it would be much better if I could find out what kind of fields are in the SQL.
Seems that there should be something like RSFields.fields(i).type or RSFields.fields(i).length.
I'm not always good at explaining things so I hope this is clear enough.
Thanks
Derek Williams |
|
|
|
Re: SLX Field Types
Posted: 06 Sep 06 2:29 AM
|
fiogf49gjkf0d I have not tried this, but assuming the SLX recordsets behave 'normally' you should be able to do something like:
Select Case objRecordset.Fields.Item(X).Type Case 5 ' number Case 7 ' datetime Case 202 ' string Case Else ' something else End Select
This gives the type values: http://www.w3schools.com/ado/prop_type.asp
|
|
|
|
Re: SLX Field Types
Posted: 12 Sep 06 2:13 PM
|
fiogf49gjkf0d Thanks Stuart,
This works OK. One problem though is how to find out the field length of an empty string field.
Since I'm only using the Account table right now, I'll just enter the values in the code.
Is your picture of a man having trouble with his umbrella? |
|
|
|
Re: SLX Field Types
Posted: 13 Sep 06 2:16 AM
|
fiogf49gjkf0d Originally posted by Derek Williams
This works OK. One problem though is how to find out the field length of an empty string field. Since I'm only using the Account table right now, I'll just enter the values in the code.
|
|
I didn't need the lengths, and I can't see how you would get them.
Is your picture of a man having trouble with his umbrella?
|
|
It's a road sign meaning road works ahead, which had blown onto its side, which I found amusing. We do refer to the sign as 'men with opening umbrellas ahead' though. Original picture is here: http://www.flickr.com/photos/stuartajc/180552709/
|
|
|
|
Re: SLX Field Types
Posted: 13 Sep 06 1:46 PM
|
fiogf49gjkf0d You're a limey! Thought as much. Is SLX popular in the UK?
Just browsed most of your photos. Can I email you so as not to use this forum inappropriately?
derekberek@verizon.net |
|
|
|
Re: SLX Field Types
Posted: 14 Sep 06 2:35 AM
|
fiogf49gjkf0d There are quite a few SLX users over here, not sure how many though.
I have emailed you about Flickr... |
|
|
|
Re: SLX Field Types
Posted: 14 Sep 06 3:00 PM
|
fiogf49gjkf0d To get the fields size there are two properties on the field object.
DefinedSize will display the defined field size in the database, or the size that the field's values can be. This is likely the one you are after.
ActualSize will display the actual size (length in bytes) that the field's value actually is.
-Ryan
|
|
|
| |
|
Re: SLX Field Types
Posted: 21 Sep 06 6:54 PM
|
fiogf49gjkf0d Where do i find a list of all the recordset-object properties and methods?
I have been using the object browser in VB6, but the properties and methods do not look correct for SLX.
Is intellisense in SLX meant to work for ADO objects?
Thanks
Derek |
|
|
| |
|
Re: SLX Field Types
Posted: 21 Sep 06 9:23 PM
|
fiogf49gjkf0d Thanks Ryan. I just ordered the book from Amazon. |
|
|
|