>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