Quantcast
Channel: Classic ASP
Viewing all articles
Browse latest Browse all 488

MySQL & ADO

$
0
0

Hi,

In a database I have a date which looks like this: 0000-08-01 01:21:00

The style of the date is NOT changeable due to it fits another website which I am writing an export function for.

The error which occurs is this:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. 

The line in which the error occurs if the very first line shown below:

If Not IsNull(ColumnRecord.Fields(x).Value) Then
  FieldsNameValue = CStr(Right("0000" & Year(ColumnRecord.Fields(x).Value), 4) & "-" & _ 
                         Right("00" & Month(ColumnRecord.Fields(x).Value),2) & "-" & _
                         Right("00" & Day(ColumnRecord.Fields(x).Value),2) & " " & _
                         Right("00" & Hour(ColumnRecord.Fields(x).Value),2) & ":" & _ 
                         Right("00" & Minute(ColumnRecord.Fields(x).Value),2) & ":" & _
                         Right("00" & Second(ColumnRecord.Fields(x).Value),2))
ElseIf Not IsNull(ColumnRecord.Fields(x).Value) And CStr(ColumnRecord.Fields(x).Value) = "" Then 
  FieldsNameValue = "0000-00-00 00:00:00"  
Else
  FieldsNameValue = "NULL"  
End If

Anyone who has an idea to get around this problem ?


Viewing all articles
Browse latest Browse all 488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>