Solved

ISSUES READING ACCESS MDB DATE AND TIME WITHIN DREAMWEAVER...NEED HELP!

Posted on 2004-10-20
8
215 Views
Last Modified: 2010-04-07
Hi....hopefully, this isn't a difficult one to answer.

I am building some asp.net pages in Macromedia Dreamweaver, and am having trouble with how Dreamweaver is reading the DATE and TIME columns of the access database that is my OLE DB data connection for the data within the pages!  I really don't know if this is a dreamweaver issue, ASP.NET code (OLE DB), or an MS ACCESS problem, so I may have to repost this in other categories!

Anyways...when I created the database in Access, I set up the columns for DATE and TIME as type (DATE/TIME) then adjusted the format so that it would be "Short Date" and "Short Time".  THUS, the columns look like this

DATE          TIME
8/21/1998   18:05

And so forth!

When I read the data in an ASP.net page created by Dreamweaver (or just when I test the data connections), it ends up reading like this:

DATE                                        TIME
Fri Aug 21 00:00:00 EDT 1998    Sat Dec 30 18:05:00 EST 1899

This is not what I want!  How can I make the page read like it is shown in MS ACCESS???????????  Is this just a format issue within Dreamweaver?  

Thanks for all and any help!

-Eric
0
Comment
Question by:zoomer777
  • 4
  • 2
8 Comments
 
LVL 10

Expert Comment

by:rockmansattic
ID: 12361006
how bout this.

in the bindings tab of the applications tab.
click the dropdown for the format and select your date time format .  

DW will format the output  ti to fit it.


Rockman
0
 

Author Comment

by:zoomer777
ID: 12361160
I don't see anything in the "bindings" tab that has to do with format.  You click the plus button, and your choices are:

Dataset(Query)
Stored Procedure
Get More Data Sources...

???
0
 
LVL 10

Expert Comment

by:rockmansattic
ID: 12361180
no, while the date on your page is selected, the applications panel will show you all the fields that you requesed in the sql query.  while it is selected, the fomat dropdown box will be available.

Ill see if I can get you the actual code.

Rockman
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 10

Expert Comment

by:rockmansattic
ID: 12361212
try this

<%= DoDateTime((*******.Fields.Item("******").Value), 2, 1033) %>
<%= DoDateTime((*******.Fields.Item("*******").Value), 3, 1033) %>

(replace ****with appropriate data)

Rockman
0
 

Author Comment

by:zoomer777
ID: 12361336
Ok, let's use this example...

I'm looking at my datagrid...I have columns titles "First_Launch" and "Last_Launch"...these are DATE/TIME fields, but really, they only have the DATE entered (time does not matter for these fields!) in the original MS Access DB.  I can't really select any individual columns in the datagrid, but I can see the code for these columns:

<asp:BoundColumn DataField="First_Launch"
        HeaderText="First_Launch"
        ReadOnly="true"
        Visible="True"/>
    <asp:BoundColumn DataField="Last_Launch"
        HeaderText="Last_Launch"
        ReadOnly="true"
        Visible="True"/>

I also can select the individual columns in the "Bindings" tab of the application toolbox, but I do not see any Format choices anywhere.  When I look at the database tab of the application box, I see that for the table I am pulling the data from, that it is "Date8" or something like that?  Is there code I can throw into the BoudColumn DataField to change the display format?

0
 
LVL 10

Accepted Solution

by:
rockmansattic earned 125 total points
ID: 12361424
Not too sure with asp.net.. but really look around in the bindings tab.  but make sure that you have that field selected on the page, (if possible) DW only gives you the format option if it is selected.

BUT using only code the above function should work if you can convert it for asp.net..
But I forgot to give you the function itself

the DoDateTime function should do the trick.

<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>                              
function DoDateTime(str, nNamedFormat, nLCID)                        
      dim strRet                                                
      dim nOldLCID                                                
                                                            
      strRet = str                                                
      If (nLCID > -1) Then                                          
            oldLCID = Session.LCID                                    
      End If                                                      
                                                            
      On Error Resume Next                                          
                                                            
      If (nLCID > -1) Then                                          
            Session.LCID = nLCID                                    
      End If                                                      
                                                            
      If ((nLCID < 0) Or (Session.LCID = nLCID)) Then                        
            strRet = FormatDateTime(str, nNamedFormat)                  
      End If                                                      
                                                            
      If (nLCID > -1) Then                                          
            Session.LCID = oldLCID                                    
      End If                                                      
                                                            
      DoDateTime = strRet                                          
End Function                                                      
</SCRIPT>                                                      
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HELP.. background images in eblasting 25 383
Setting up PHP server 3 213
How to use fonts that are .otf file format with Adobe Dreamweaver CC 2015? 12 305
Jquery submit form question 11 118
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question