Bonjour,
Je rencontre l'erreur suivante sur une macro vba
"run time error '3065' cannot execute a select query"
Le code est le suivant :
Sub test()
Static sql2 As String
Dim db As Database
Dim isin_oc As String
isin_oc = "XS0329434970"
'OUVERTURE DE LA BASE
Set db = OpenDatabase("C:\Documents and Settings\kelhah\Desktop\TEST.mdb")
sql2 = "select distinct vi_ask from histovol where dat=(date()-1) and ISIN='" & isin_oc & "'"
db.Execute sql2db.Close
End Sub
La structure de la table est la suivante :
Table : Histovol
Champs:
ISIN de type Text
VI_ASK de type Text
DAT de type Date\Time
Merci pour votre aide