[VB6] Type de colonne Access sous VB ?
Salut,
Voila, j'ai un souci dans mon appli. L'utilisateur à la possibilité de choisir le format des dates. Donc, pour toutes les données de ma base qui sont de type Date, je dois les afficher avec ce format (libre).
J'ai notamment une MSHFlexGrid avec des colonnes (la aussi, choisie par l'utilisateur). J'ai donc voulu utiliser la méthode OpenSchema pour récuperer le type de la colonne en fonction de son nom. Mais j'ai le message d'erreur suivant lorsque je teste la valeur qui m'est retournée.
Code:
1 2
| Run-time error '458':
Variable uses an Automation type not supported in Visual Basic |
Voic mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| With Install_MsHFlexGrid
.FixedRows = 1
.TextMatrix(tmp_index, 0) = RsDeal.Fields!IDDeal
For tmp_col = 1 To 13
.Row = tmp_index
.Col = tmp_col
.CellBackColor = tmp_backcolor
.CellFontName = tmp_font
.CellFontSize = tmp_fontsize
.CellFontBold = False
.WordWrap = True
.CellAlignment = 1
If IsNull(RsDeal.Fields(StrGloContCol(tmp_col))) Then
.TextMatrix(tmp_index, tmp_col) = "-"
.CellAlignment = 4
Else
Set RsTableSchema = BaseConnect.OpenSchema(adSchemaColumns, Array(Empty, Empty, Empty, StrGloContCol(tmp_col)))
If RsTableSchema.Fields("DATA_TYPE").Value = adDate Then
' Date Format
.CellAlignment = 4
.TextMatrix(tmp_index, tmp_col) = _
Format(RsDeal.Fields(StrGloContCol(tmp_col)), _
StrGloDateFormat)
End If
RsTableSchema.Close
End If
Next tmp_col
Wend |
RsDeal et RsTableSchema sont tous les deux des ADODB.Recordset.
VB m'affiche le message sur la ligne suivante :
Code:
If RsTableSchema.Fields("DATA_TYPE").Value = adDate Then
Y'en a qui comprenne ce qui se passe et ce que cela signifie ? Parce que moi..... :oops: