VB 6 and SQL - TechRepublic
Question
August 17, 2009 at 11:59 PM
dilumd

VB 6 and SQL

by dilumd . Updated 16 years, 10 months ago

I have developed an Inventory control system using Visual basic 6 and back end as Sql Server 2000.

When i try to access data through below mentioned SQL string,

rstGrn.Open “Select stgrnsub.grnqty From StGrnSub Inner join StGrnMain on stgrnsub.grnref = stgrnmain.grnref Where ((StGrnSub.grnicode = ‘” & sICode & “‘) And ((stgrnmain.grndt >= ‘” & dtOSdt & “‘) and (stgrnmain.grndt <= '" & dtOEdt & "')))", goConn, adOpenStatic, adLockPessimistic it gives me an error. That is Run-time error '2147217913 (80040e07)'. The conversion of a char data type to a datetime data type resulted in an our-of-range datetime value. So i changed the date format in My PC using control panel regional options from dd-mm-yyyy to yyyy-mm-dd. After this change above sql query worked fine. My question is that, is there a way to run this sql query without changing the date format of the windows. (Im using win xp)

This discussion is locked

All Comments