Solved

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

Posted on 2004-10-20
8
201 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Dreamweaver CS6 FTP issues 12 1,291
Dreamweaver CS6 Sites Setup 2 420
Website Design 13 107
I'm running a risk by using Adobe Flash in my site ? 9 110
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 …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

20 Experts available now in Live!

Get 1:1 Help Now