?
Solved

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

Posted on 2004-10-20
8
Medium Priority
?
230 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 
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 500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

777 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