Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to obtain field type
Message
De
10/05/2005 17:31:11
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How to obtain field type
Versions des environnements
OS:
Windows Server 2003
Database:
MS SQL Server
Divers
Thread ID:
01012618
Message ID:
01012618
Vues:
51
Hello
I need to know how i can obtain the field type when i run a recordset and i want to format its data fields. I have this code in VBA , i build them like this :
Private Sub nulos()
Dim rst1 As DAO.Recordset, i As Integer
Set rst1 = CurrentDb.OpenRecordset("select * from alojamentos")

Do While Not rst1.EOF
For i = 0 To rst1.Fields.Count - 1
'campos do tipo TEXT
If IsNull(rst1(i)) And (rst1(i).Type <> 8 And rst1(i).Type <> 7) Then
rst1.Edit
rst1(i) = " "
rst1.Update
'campos do tipo DATE
ElseIf IsNull(rst1(i)) And (rst1(i).Type = 8) Then
rst1.Edit
rst1(i) = 1
rst1.Update
'campos do tipo NUMERIC
ElseIf IsNull(rst1(i)) And (rst1(i).Type = 7) Then
rst1.Edit
rst1(i) = 0
rst1.Update
ElseIf Not IsNull(rst1(i)) And (rst1(i).Type = 10) Then
If Len(rst1(i)) = 0 Then
rst1.Edit
rst1(i) = " "
rst1.Update
End If
End If
Next i
rst1.MoveNext
Loop
MsgBox ("Já acabei...!")

End Sub

Like you see , for example if (rst1(i).Type = 7) is NUMERIC FIELD

I need to now for the field types in VFP.

Many Thanks
Luis Santos
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform