SQL VB ADO Error Please Help Me 
Author Message
 SQL VB ADO Error Please Help Me

Hi I've got a problem with ado

I'm  connecting to a SQL Server 6.5 with ado2.0 from VB6.0
If I use the following SQL it does not bring back a recordset

SELECT TRANS_REF, TRANS_ID FROM TRANSACTIONS WHERE INT_SETT_DATE = NULL AND
STATUS_CHANGE_TIME LIKE 'Feb 16 1999%'

if I use the same SQL on the server it works fine.

My connection info is:-
Provider=MSDASQL.1;Connect Timeout=15;Extended Properties="DRIVER=SQL
Server;SERVER=testdb;UID=sa;APP=Visual
Basic;WSID=8846CCJ86825;DATABASE=dred";Locale Identifier=2057

If I use
SELECT TRANS_REF, TRANS_ID FROM TRANSACTIONS WHERE INT_SETT_DATE = NULL AND
STATUS_CHANGE_TIME LIKE 'Feb 16 1999%'
with out the where it works fine!

Thanks for any help



Sat, 04 Aug 2001 03:00:00 GMT  
 SQL VB ADO Error Please Help Me
Kinsley,

According to ANSI standards, nothing can ever equal null.

Use:

SELECT TRANS_REF, TRANS_ID FROM TRANSACTIONS WHERE INT_SETT_DATE IS NULL
AND STATUS_CHANGE_TIME LIKE 'Feb 16 1999%'

Matthew



Quote:
> Hi I've got a problem with ado

> I'm  connecting to a SQL Server 6.5 with ado2.0 from VB6.0
> If I use the following SQL it does not bring back a recordset

> SELECT TRANS_REF, TRANS_ID FROM TRANSACTIONS WHERE INT_SETT_DATE = NULL
AND
> STATUS_CHANGE_TIME LIKE 'Feb 16 1999%'

> if I use the same SQL on the server it works fine.

> My connection info is:-
> Provider=MSDASQL.1;Connect Timeout=15;Extended Properties="DRIVER=SQL
> Server;SERVER=testdb;UID=sa;APP=Visual
> Basic;WSID=8846CCJ86825;DATABASE=dred";Locale Identifier=2057

> If I use
> SELECT TRANS_REF, TRANS_ID FROM TRANSACTIONS WHERE INT_SETT_DATE = NULL
AND
> STATUS_CHANGE_TIME LIKE 'Feb 16 1999%'
> with out the where it works fine!

> Thanks for any help



Sat, 04 Aug 2001 03:00:00 GMT  
 SQL VB ADO Error Please Help Me

Wouldn't it be faster to use the BETWEEN statement instead of the string-like
comparision ?

I.e.: SELECT TRANS_REF, TRANS_ID FROM TRANSACTIONS WHERE INT_SETT_DATE IS NULL
AND STATUS_CHANGE_TIME BETWEEN 'Feb 16 1999' AND 'FEB 17 1999'

If STATUS_CHANGE_TIME is a DATETIME, that is.

Tom.

On Tue, 16 Feb 1999 14:47:18 -0800, "Matthew Wills"

Quote:

>Kinsley,

>According to ANSI standards, nothing can ever equal null.

>Use:

>SELECT TRANS_REF, TRANS_ID FROM TRANSACTIONS WHERE INT_SETT_DATE IS NULL
>AND STATUS_CHANGE_TIME LIKE 'Feb 16 1999%'

>Matthew



>> Hi I've got a problem with ado

>> I'm  connecting to a SQL Server 6.5 with ado2.0 from VB6.0
>> If I use the following SQL it does not bring back a recordset

>> SELECT TRANS_REF, TRANS_ID FROM TRANSACTIONS WHERE INT_SETT_DATE = NULL
>AND
>> STATUS_CHANGE_TIME LIKE 'Feb 16 1999%'

>> if I use the same SQL on the server it works fine.

>> My connection info is:-
>> Provider=MSDASQL.1;Connect Timeout=15;Extended Properties="DRIVER=SQL
>> Server;SERVER=testdb;UID=sa;APP=Visual
>> Basic;WSID=8846CCJ86825;DATABASE=dred";Locale Identifier=2057

>> If I use
>> SELECT TRANS_REF, TRANS_ID FROM TRANSACTIONS WHERE INT_SETT_DATE = NULL
>AND
>> STATUS_CHANGE_TIME LIKE 'Feb 16 1999%'
>> with out the where it works fine!

>> Thanks for any help



Sun, 05 Aug 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

2. Problem seeking for records with ADO and SQL Server, Please Help

3. Please help me with SQL & ADO/DAO

4. Problem seeking for records with ADO and SQL Server, Please Help

5. Please help!! ADO SQL

6. VB nerds please-ado and sql query!!

7. SQL Server ADO Command Parameters Problem - Please Help

8. Problem seeking for records with ADO and SQL Server, Please Help

9. Any ADO help please please help sir

10. please help w/ overflow error on ADO connection.

11. Error using ADO, Please help

12. Error using ADO, Please help

 

 
Powered by phpBB® Forum Software