Вопрос: Как ппрограмно (т.е. кодом, а не на глаз) определить
тип данных определённого поля (Field) в Recordset-e?
эээ ... красиво!

У меня выдаёт ошибку при:
MsgBox СStr(.adodc_Main.Recordset.Fields(i).DataFormat)
--
Заранее огромное спасибо!
Return the basic characteristics of a field with the Type, Precision, and NumericScale properties.
Public Sub TypeX()
Dim rstEmployees As ADODB.Recordset
Dim fldLoop As ADODB.Field
Dim strCnn As String
' Open recordset with data from Employees table.
strCnn = "Provider=sqloledb;" & _
"Data Source=MyServer;Initial Catalog=Pubs;User Id=sa;Password=; "
Set rstEmployees = New ADODB.Recordset
rstEmployees.Open "employee", strCnn, , , adCmdTable
Debug.Print "Fields in Employees Table:" & vbCr
' Enumerate Fields collection of Employees table.
For Each fldLoop In rstEmployees.fields
Debug.Print " Name: " & fldLoop.Name & vbCr & _
" Type: " & FieldType(fldLoop.Type) & vbCr
Next fldLoop
End Sub
'EndTypeFieldVB
'BeginTypeField2VB
Public Function FieldType(intType As Integer) As String
Select Case intType
Case adChar
FieldType = "adChar"
Case adVarChar
FieldType = "adVarChar"
Case adSmallInt
FieldType = "adSmallInt"
Case adUnsignedTinyInt
FieldType = "adUnsignedTinyInt"
Case adDBTimeStamp
FieldType = "adDBTimeStamp"
End Select
End Function
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 3