Board index » delphi » MSSQL 6.5 "General SQL Error "

MSSQL 6.5 "General SQL Error "

We are converting a client from Paradox to MSSQL. We are getting a General
SQL Error when an edit is posted. We are running service pack 1. Can anyone
help us?

We are also experiencing a problem when a record is posted in a table with
an index and a filter. After the post, the index jumps to a different
record.

David Carroll
dcarr...@netpathway.com

 

Re:MSSQL 6.5 "General SQL Error "


David,
  I had a similar problem using the POST method of updating data on MSSQL.
I found a better solution by writing my own update procedure using a TQuery
component and SQL.

Here is a small example:

Procedure UpdateCust(CustNum:String; FirstName:String; LastName:String);
var
   tik :String;
begin
   tik := ''''               { the   '   character}
   try
      Query.Close;
      Query.SQL.Clear;
      Query.SQL.Add('Update Customers');
      Query.SQL.Add('SET ' );
      Query.SQL.Add('    FirstName = ' + tik + Firstname + tik + ',');
      Query.SQL.Add('    LastName = ' + tik + LastName + tik + ',');
      Query.SQL.Add(' Where CustNum = ' + tik + CustID + tik);
      Query.ExecSQL;
   except
      on E:EDBEngineError do
         begin
            ShowMessage(E.Message);
            Query.Close;
         end;
   end;
end;

The procedure (of course I pass a few more variables and set a few more
fields) returns almost instantaneous on our 800,000+ record customer table.

Good luck,
krf

David Carroll <dcarr...@netpathway.com> wrote in article
<68tpuk$4...@forums.borland.com>...

Quote
> We are converting a client from Paradox to MSSQL. We are getting a
General
> SQL Error when an edit is posted. We are running service pack 1. Can
anyone
> help us?

> We are also experiencing a problem when a record is posted in a table
with
> an index and a filter. After the post, the index jumps to a different
> record.

> David Carroll
> dcarr...@netpathway.com

Other Threads