VB/SQL Server 6.5: quoted string 
Author Message
 VB/SQL Server 6.5: quoted string

I was able to execute this embedded SQL statement from within
VB4:

SELECT OrganizationMasterID
FROM   OrganizationMaster
WHERE  Name = "A'BC"

Where name in the where clause includes a single quote.

I get error: Invalid column name ABC; although, it is the value of the
column
and not the column itself.

It used to work with SQL Server 4.x.

It would work on version 6.5.
Any idea why.
Thanks in advance.
M. Aoun



Sun, 21 Mar 1999 03:00:00 GMT  
 VB/SQL Server 6.5: quoted string

Quote:

> I was able to execute this embedded SQL statement from within
> VB4:

> SELECT OrganizationMasterID
> FROM   OrganizationMaster
> WHERE  Name = "A'BC"

> Where name in the where clause includes a single quote.

> I get error: Invalid column name ABC; although, it is the value of the
> column
> and not the column itself.

> It used to work with SQL Server 4.x.

> It would work on version 6.5.
> Any idea why.
> Thanks in advance.
> M. Aoun


With SQLBase I would use:
WHERE  Name = 'A''BC'

perhaps this will work for you.
--
Thomas Hugel
Brown Distributing Co. (Budweiser)
1330 Allendale Rd.
West Palm Beach, FL 33405



Sun, 21 Mar 1999 03:00:00 GMT  
 VB/SQL Server 6.5: quoted string



Quote:
> SELECT OrganizationMasterID
> FROM   OrganizationMaster
> WHERE  Name = "A'BC"

cut...

Quote:
> It used to work with SQL Server 4.x.

> It would work on version 6.5.

Do you mean it would not work on version 6.5?

Version 4.xx allows the use of " as well as ' as a string
delimiter by default. Incidently " is NOT the norm for SQL.

This has been changed for 6.5 so " will not work by default.
I believe there is a user option on SQL Server 6.5 to allow
the use of ". I suggest however that you change to ' and
double up on embedded ' when reuired.

HTH
--
ernest     at Noel Systems, near Kingston-upon-Thames (UK)



Mon, 22 Mar 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB 5.0 and SQL Server 6.5 Contract

2. VB 6.0 & SQl server 6.5

3. SQL Server 6.5 timestamps to VB?

4. VB & SQL Server 6.5 Contract

5. LONDON - VB 5.0/Sql-Server 6.5/ NT 4 - Developers - Derivatives Trading Systems

6. LONDON - VB 5.0/Sql-Server 6.5/ NT 4.0 - Developers - Derivatives Trading Systems

7. Error doing update with VB 3.0 and SQL Server 6.5

8. ODBC with SQL Server 6.5 in VB 4

9. executing SQL Server 6.5 stored procedure using VB 5

10. VB 5.0, SQL Server 6.5

11. Help SQL SERVER 6.5/VB 5.0

12. Suggestions for a CASE Tool using VB 4/SQL Server 6.5

 

 
Powered by phpBB® Forum Software