If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Getting/Setting Field Format Property ADO

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-18-04, 09:42
VectorX VectorX is offline
Registered User
 
Join Date: Mar 2004
Posts: 6
Getting/Setting Field Format Property ADO

Hello,

I am connecting to a Access XP MDB file using VB6 via ADO 2.5.

I am in need of getting the Field (format/layout) of the fields in a RecordSet and cannot find any information on this topic.

eg:
Field Name 'DOB'
Format 'dd mmm yyyy'

Field Name 'LastName'
Format '>'

I want to be able to get that format string into a variable in VB.

Any help would be appritiated.
Reply With Quote
  #2 (permalink)  
Old 03-18-04, 23:04
SCIROCCO SCIROCCO is offline
Registered User
 
Join Date: Mar 2004
Location: www.scirocco.ca
Posts: 346
Re: Getting/Setting Field Format Property ADO

Cycle through the properties in your field object and list them like this:

For iCounter = 0 To 100

debug.print rs.Fields.Item(0).Properties(iCounter).Name

Next iCounter

This will show you all the properties available to you in the field object. Then you will see if you can access a format property. Depending on which data provider you connect to you may or may not have that feature.
__________________
http://www.scirocco.ca/images/banner...occobanner.gif

Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

Or try our Ask An Expert service to answer any of your questions!
Reply With Quote
  #3 (permalink)  
Old 03-18-04, 23:12
VectorX VectorX is offline
Registered User
 
Join Date: Mar 2004
Posts: 6
Lightbulb

hey man thanks for the reply,

i already tried that, only got 9 properties but and format wasnt one of them.

the provider is jet oledb 4.0 which is the most current version and its not available in it.

so i dont know what to do coz its kind of important, if not im probably gonna have to set a diff value in the field or make a table with field formats, hehe.
Reply With Quote
  #4 (permalink)  
Old 03-19-04, 08:36
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,606
The closest thing I can think of is a FieldAttributeEnum. Aren't the actual formats of the items in the fields collection set by the client machine in its Regional Settings???

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On