Greetings -
I want to use ADO instead of the BDE. However, I'm having trouble
with the following statement:
update Customers
set CustomerID = upper(CustomerID)
I received the following error message:
Project Simple_ADO.exe raised exception class EoleException with
message 'undefined function 'upper' in expression.' Process stopped.
Use step or run to continue.
This SQL statement works fine when I run it against a Paradox table
using the BDE.
Your help is greatly appreciated!
Ken
Other information:
I'm using ...
Delphi Version 6.0 Build 1.163
Windows XP Home Edition
Here is the specific code segment I'm using. I'm creating the ADO
object 'on-the-fly.' AppDBPath is the location of the executable plus
the folder "\AppDB" underneath the executable location.
procedure TForm1.btnChangeIDClick(Sender: TObject);
// Execute an ADO SQL string
var
ADOQuery : TADOQuery;
begin
ADOQuery := TADOQuery.Create(nil);
// Establish the ADO connection string
ADOQuery.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;'+
'Data Source='+AppDBPath+'Southwind.mdb'+';'+
'Persist Security Info=False';
try
if (pos('upper', ADOQuery.SQL.Text) > 0) then
begin
ShowMessage ('Changing CustomerID to LowerCase');
ADOQuery1.Active := false;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('update Customers');
ADOQuery1.SQL.Add('set CustomerID = lower(CustomerID)');
ADOQuery1.ExecSQL;
end
else
begin
ShowMessage ('Changing CustomerID to UpperCase');
ADOQuery1.Active := false;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('update Customers');
ADOQuery1.SQL.Add('set CustomerID = upper(CustomerID)');
ADOQuery1.ExecSQL;
end; // see which state the ado object is
finally
ADOQuery.Free;
end; // try-finally-end
end; // procedure TForm1.btnChangeIDClick(Sender: TObject);
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/