Announcement

Collapse
No announcement yet.

Access - correct data type?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Access - correct data type?

    Hello

    I have an ASP script that displays the contents of a MS Access 2003 database in a Web page here:

    http://www.bayingwolf.com/wolfdb/display_records.asp

    The script itself looks like this:

    Code:
    <%....connect to database
    
    Dim conn, Format, rs, my_fullName, etc
    
    my_fullName = Replace( Request.Form("fullName"), "'", "''" )
    my_wolfID = Replace( Request.Form("wolfID"), "'", "''" )
    my_telNo = Replace( Request.Form("telNo"), "'", "''" )
    my_address = Replace( Request.Form("address"), "'", "''" )
    my_email = Replace( Request.Form("email"), "'", "''" )
    my_description = Replace( Request.Form("description"), "'", "''" )
    
    'my_received = CDATE( Request.Form("received") )
    
    'my_received = Replace( Request.Form("received") )
    
    'my_received = Replace( Request.Form("received"), "'", "''" )
    
    'my_received = "#" & Format(Request.Form("received"), "yyyy-mm-dd") & "#"
    
    my_received = Request.Form("received")
    my_action = Replace( Request.Form("action"), "'", "''" )
    my_dispatched = Replace( Request.Form("dispatched"), "'", "''" )
    
    ....build insert statement, connect and execute, write on screen%>
    That is, the data is only successfully displayed when I incorrectly use 'Replace' (as above).

    I think I should be using 'my_received = CDATE( Request.Form("received") )' and my_dispatched = CDATE( Request.Form("dispatched") )

    but if I have Date/Time as my Data Type in my Access db, I get error messages, so I have defined all the data types as 'Text' (screenshot).

    How may I overcome this, please?

    Thanks!
    Attached Files
Working...
X