Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create INSERT with datetime type field?
Message
 
 
À
22/08/2005 08:52:33
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01042503
Message ID:
01206040
Vues:
21
>For SQL server see the parametric approach. It also handles headaches for conversion if field on VFP side is either date or datetime. ie:
>
>
>* f1: char, f2: datetime, f3:datetime
>cInsertCmd = "insert into myTable (f1, f2, f3) values (?m.Value1, ?m.Value2, ?m.Value3)"
>SQLPrepare(m.lnHandle,m.cInsertCmd)
>m.ldStart=date()
>for ix=1 to 5
>  m.Value1 = cdow(m.ldStart+m.ix-1)
>  m.VAlue2 = m.ldStart + m.ix - 1
>  m.Value3 = datetime() - (m.ix * 3600)
>  SQLExec(m.lnHandle)
>endfor
Cetin

Cetin,

Could you please tell me, how would you insert dates into Access database using parameters. I don't have Access installed on my work computer :(, but as I understood, we need to use character variable and not a date. Am I correct?

Thanks a lot in advance for your answer.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform