Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_ado_rds thread: Re: Data types/Format of recordset fields in ADO


Message #1 by skip@f... on Wed, 12 Mar 2003 05:06:09
Sara,

It's nice to see someone using ASP JavaScript (or JScript, as Microsoft 
calls it)!

There seems to be some sort of mismatch with ADO date/time types and 
JavaScript. When going from ADO to JavaScript:
 
  var dt=new Date(""+rs("datetime-field"));

should do the trick, allowing you to use all the JavaScript Date methods 
and properties. When going the other way:

  rs("datetime-field")=""+(dt.getMonth()+1)+"/"+dt.getDate()
+"/"+dt.getFullYear();  // you can add the time, too, in a similar fashion

should do the trick. For some reason ADO and JavaScript don't get along 
when it comes to datetime types.

There's a few other little quirks, but we'll cross those bridges when you 
get there.

Skip

  Return to Index