If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Error when passing date values via ADO Recordset.Open method

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-20-03, 11:19
ATJaguarX ATJaguarX is offline
Registered User
 
Join Date: Oct 2002
Posts: 3
Angry Error when passing date values via ADO Recordset.Open method

Breakdown:

VB6
SQL Server

The following works in the US locale, but not UK locale(2057).

Recordset.Open "sp_GetEvent '" & strDate & "'

The following error is generated:

"Error converting data type varchar to datetime"

I have to use Recordset.Open due to specified cursor type. I know I can set the active connection, command text and parameters etc... in a command object and have the recordset open the command object, but due to time constraints, this might be too costly.

Am I doing something wrong? What am I missing? Is there a quick fix?

Remember... this is NOT problem in the US. I'm having the problem when changing the regional settings from US to UK.

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 11-21-03, 17:28
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
What is the format of the date that is being passed ? Also, are you converting the date ? You can do the following with the stored procedure - convert(datetime,'31-12-1999 15:00',103) - The 103 is for British/French date formats.
Reply With Quote
  #3 (permalink)  
Old 11-27-03, 12:06
Marvels Marvels is offline
Registered User
 
Join Date: Jul 2003
Location: Amsterdam, Nederland
Posts: 449
Wink hi

U can allso use Cdate functin

Cdate(rs.date)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On