Date insertion to Database and format

Results 1 to 2 of 2

Thread: Date insertion to Database and format

  1. #1
    Join Date
    Dec 1969

    Default Date insertion to Database and format

    I am trying to automatically insert a date into an Access2000 database, however it is always inserted with the format of yy/mm/dd. <BR><BR>Is there a way to insert it in the format mm/dd/yy and also is it possible to have it inserted as the date at the server rather than the user end? <BR><BR>The code I have so far is: <BR><BR>&#060;% <BR>If request.form("cmdSubmit") = "Add" then <BR>&#039;process the request and add the record to the database <BR>Dim DBName, objConn, objRS, strSQL,TempVal &#039;//Variables we need <BR>Set objConn = Server.CreateObject("ADODB.Connection") <BR>objConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:/c/o/coiavakharnet/private/guild.mdb" <BR>objConn.Open <BR>Set objRS = Server.CreateObject("ADODB.Recordset") <BR>strSQL = "Insert into News(Title, Article_Text,Member_ID,Date_Created) values(&#039;" & replace(request.form("txtTitle"),"&#039;","&#039;& #039;") & "&#039;,&#039;" & replace(request.form("txtArticle_Text"),"&#039;"," &#039;&#039;") & "&#039;," & session("Member_ID") & ",#" & Date() & "#)" <BR>Set objRS = objConn.execute(strSQL) <BR><BR>%&#062; <BR><BR>Any thoughts or ideas?

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default STICK to one forum

    do NOT crosspost<BR><BR><BR>oh and this is NOT advanced......NEVER post basic questions like this in the advanced forum<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts