Solved

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

Posted on 2004-10-20
8
206 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Insert multiple row form with checkboxes 9 1,019
Dreamweaver Styles 7 397
xml to xml using xslt and php 4 549
Add server behaviors to Dreamweaver CC 2015 2 130
For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now