SQL REPLACE function does not work thru ADO/DAO/OLE layer

From: rmsterling (rmsterling_at_avaya.com)
Date: 11/12/04


Date: Fri, 12 Nov 2004 02:39:03 -0800

Windows 2000 Professional installed with Service Pack 4.
MDAC 2.8 installed.
Visual Basic 6.0 installed with Service Pack 5.

SQL REPLACE function executes fine in a Access 2003 Query window with an
Access 2000 database.

Run the same query in a VB6 SP5 program causes an error through the DAO/OLE
layer.

References
 Microsoft DAO 3.6
 Microsoft ADO 2.8

' Connection Defined & Setup
Global adoConnection As New ADODB.Connection
adoConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
sDBLocation & "\" & DB_FILENAME & ";"

' Query Defined & Executed
Dim sSQL As String
sSQL = "UPDATE Question SET sScriptLine=REPLACE(sScriptLine,'LINE:11 ','L ')
WHERE lRunNo = 45;"
adoConnection.Execute sSQL

' Error produced from running query
ADO/DAO/OLE Error
Number : -2147217900 (80040E14 Hex)
Desc : Undefined function 'REPLACE' in expression.
Native : -530123806
Source : Microsoft JET Database Engine
SQL State : 3085

Can anyone tell me what I need to do to get this to work?

-- 
----------------------------
Regards,
Richard Sterling 
Senior Software Engineer Tel : +44 (0)1707 392200 ext 4815 
Avaya ECS Ltd, United Kingdom 
mailto:rmsterling@avaya.com 


Relevant Pages

  • SQL REPLACE function does not work thru ADO/DAO/OLE layer
    ... Windows 2000 Professional installed with Service Pack 4. ... SQL REPLACE function executes fine in a Access 2003 Query window with an ... Run the same query in a VB6 SP5 program causes an error through the DAO/OLE ... SQL State: 3085 ...
    (microsoft.public.data.oledb)
  • SQL REPLACE function does not work thru ADO/DAO/OLE layer
    ... Windows 2000 Professional installed with Service Pack 4. ... SQL REPLACE function executes fine in a Access 2003 Query window with an ... Run the same query in a VB6 SP5 program causes an error through the DAO/OLE ... SQL State: 3085 ...
    (microsoft.public.vb.database.ado)
  • SQL REPLACE function does not work thru ADO/DAO/OLE layer
    ... Windows 2000 Professional installed with Service Pack 4. ... SQL REPLACE function executes fine in a Access 2003 Query window with an ... Run the same query in a VB6 SP5 program causes an error through the DAO/OLE ... SQL State: 3085 ...
    (microsoft.public.win32.programmer.ole)
  • SQL REPLACE function does not work thru ADO/DAO/OLE layer
    ... Windows 2000 Professional installed with Service Pack 4. ... SQL REPLACE function executes fine in a Access 2003 Query window with an ... Run the same query in a VB6 SP5 program causes an error through the DAO/OLE ... SQL State: 3085 ...
    (microsoft.public.data.ado)
  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)

Loading