ADODB select with GUID data type 
Author Message
 ADODB select with GUID data type

Please help!

I am trying to select a record with a specific value in a field containing
guid:s (ReplictionID).

In Access I got OK result with this query:

SELECT ReferenceSet.RefSt_Code, ReferenceSet.RefSt_Name,
ReferenceSet.RefSt_ID FROM ReferenceSet WHERE
(((ReferenceSet.RefSt_ID)={guid {72516C66-5C4D-4CCB-935C-C4BA0960850F}}));

In my Asp page, I tested to using exactly the same sql with the following
code:

set cn1=server.CreateObject("adodb.connection")

cn1.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("CBFinal_test.mdb")

set rs=server.CreateObject("adodb.recordset")

sql="SELECT ReferenceSet.RefSt_Code, ReferenceSet.RefSt_Name,
ReferenceSet.RefSt_ID FROM ReferenceSet WHERE
(((ReferenceSet.RefSt_ID)={guid {72516C66-5C4D-4CCB-935C-C4BA0960850F}}));"

rs.Open sql,cn1

I get this error message:

Microsoft OLE DB Provider for ODBC Drivers fel '80040e14'

[Microsoft][Drivrutin f?r ODBC Microsoft Access] Syntaxfel (operator saknas)
i fr?geuttrycket '(((ReferenceSet.RefSt_ID)=guid
72516C66-5C4D-4CCB-935C-C4BA0960850F}))'.

/ska/localWeb/dataFactory.asp, rad 51

Thanks in advance

Anders Nilsson



Wed, 14 Sep 2005 01:12:01 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to convert a GUID string to a GUID data type

2. ADODB.Command Output Params return null for GUID types

3. Converting a GUID data type to a String

4. Data type for GUID

5. Select VFP data into another type of data

6. Using ADODB.Parameters and SQL Text Data type

7. Problem with number data type in ADO Select SQL statement

8. Problem with number data type in ADO Select SQL statement

9. Get error: Disallowed implicit conversion from data type varchar to data type money

10. Data type conversion error when saving numeric data types

11. Q: variant data type with user defined data type

12. C data type vs. VB Data type

 

 
Powered by phpBB® Forum Software