Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datetime to SQL SERVER
Message
De
05/01/2009 15:03:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01371088
Message ID:
01371153
Vues:
28
>Hi.
>I am trying to popuate a sql server table Data time field from a foxpro table
>I have set Set date British or Set Date american before creating the fields
>(Some are string fields and some are character fields)
> I want to populate
>This all works fine on my PC but when I deploy to client's site,
> the datas are all mixed up (getting the Days/Months wrong)
>
>Is there something else I need to check
>I am using TTOC(DTOT(MyDate))
>Regards,
>Gerard

Solution is simple, do not use ttoc() :)
Are you using SQLExec? If so then assuming your date field's name is orderDate:
text to m.lcSQL noshow
insert into myTable 
   (charField, dateField) 
   values 
   (?myVFPTable.field1, ?myVFPTable.orderDate)
endtext


select myVFPTable
SQLPrepare(m.handle, m.lcSQL)
scan
 SQLExec(m.handle)
endscan
The important part in this sample is that, the data you pass is not hardcoded in sql string but parametric. There are of course N ways to transfer (insert/update/delete/select) data to/from SQL server and other ways even doesn't need this parameterization (automatically done by VFP).
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
Répondre
Fil
Voir

Click here to load this message in the networking platform