Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create INSERT with datetime type field?
Message
De
20/03/2007 10:12:34
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:
01206050
Vues:
27
>>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.

No you're not correct. Read the code sample in message you replied.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform