Re: update ADO Date type data to MSSQL problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Val Mazur (group51a_at_hotmail.com)
Date: 07/20/04


Date: Mon, 19 Jul 2004 22:31:51 -0400

Hi,

Hard to say why first case does not work, because I do not see any
difference, except just different steps to achieve same result. I think that
DTOT(dDate) does not return result as a Date datatype, which is compatible
with the ADO recordset's Date datatype. If ddate1 variable is declared as a
date, then it might work.

Second case (with the empty date) will not work, because you cannot assign
empty (//) date to the field. It is just not allowed in ADO. All you could
do is to assign Null value. This is why it works with Null

-- 
Val Mazur
Microsoft MVP
"tsair" <tsair@myjaring.net> wrote in message 
news:Otr%23MWwaEHA.3352@TK2MSFTNGP12.phx.gbl...
>I try this
>
> dDate = {01/01/2004}
>
> this.oRs.Fields( 'ExpDate' ).Value = DTOT(dDate)
> ERROR
>
> ddate1 = DTOT( ddate )
> this.oRs.Fields( 'ExpDate' ).Value = ddate1
> OK
>
> ddate = {//}
> ddate1 = DTOT( ddate )
> this.oRs.Fields( 'ExpDate' ).Value = ddate1
> ERROR
>
> this.oRs.Fields( 'ExpDate' ).Value = .NULL.
> OK
>
> Why like this ?
>
>
> "tsair" <tsair@myjaring.net> wrote in message
> news:OOBecTmaEHA.4048@TK2MSFTNGP10.phx.gbl...
>> I create a field with type smalldatetime in MSSQL database.
>> I use ADO to call the recordset and convert the datetime  to VFP date 
>> type
>> with TTOD()
>> I convert the date data to DateTime type with DTOT() and then send to
> MSSQL
>> update.
>>
>> I t show message : Multiple-step operation generated errors. Check each
>> status value....,
>>
>> How can i update the date value into SQL Server ?
>>
>>
>>
>
> 


Relevant Pages

  • Looking for search engine
    ... I'm Looking for a search engine that will iterate through MSSQL database and ... that perhaps can store the results in ADO but that is not a prerequisite. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Date update to SQL Server problem
    ... I missed the ADO call. ... My example only works with SQL Pass-Through. ... > I create a field with type smalldatetime in MSSQL database. ... > I convert the date back to DateTime with DTOTand then send to MSSQL ...
    (microsoft.public.fox.programmer.exchange)
  • Re: python to mssql
    ... Python works with MSSQL. ... You can go through ODBC, ADO, ... etc. to work with data in MSSQL database. ...
    (comp.lang.python)