I'm having trouble with SQL

From: gajo (gajo_at_eunet.yu)
Date: 03/21/04


Date: Sun, 21 Mar 2004 18:25:29 +0100

Hi!

I'm writing a somewhat basic SQL application. I use two local tables that
are equi-joined by their INTEGER primary keyed fields, that I determine in
my application. So here's the deal:
I have a form that the user needs to fill. Once he clicks on OK the program
checks if everything's ok, and if it's so then it inserts the data into the
table by using the INSERT INTO datas VALUES ("12","blabla","tralala")
command. When I do this I get an ENoResultSet saying that the BDE can't find
the cursor handle. Anyway, the data does get inserted, so I bypassed this
exception with "try" and the user doesn't see anything's wrong. Anyway, how
can I make this message not appear at all? The Help said I should add a
SELECT statement to the SQL command, but I don't see how.

Part 2: Even after inserting the data, some of it might go missing. For
example I inserted 6 lines and after Delphi crashed saying there isn't
enough memory 5 lines got lost, and I have no clue why the 6th didn't. I
remember seeing some SQL command in the InterBase SQL editor, something
which sounded like "save changes", but since my current Delphi 5 doesn't
have InterBase I can't find out which command it was.
Finally, the weirdest thing: I inserted the 13th data, after which I closed
my application. Then I restarted it, tried to insert something else, and got
an exception saying that I'm trying to insert a value into the primary key
field which is already inserted. In other words, field with the value 13
already exists. I check the table but there isn't any 13th field. Then I
open the table with Database Desktop and see that THERE IS a 13th field.
I thought it was some BDE error so I restarted the computer, but after I
started my program again, again there was no field 13, and again in DBD
there was. I tried Query1.Refresh, but it didn't help.

So what should I do?
Btw. I'm using Paradox7 tables, with Delphi 5, on Windows ME.

Gajo Csaba



Relevant Pages

  • Re: c# oledb - multiple inserts to access (mdb) VERY slow - help!
    ... One query regards direct sql or parameterised quert - ... Are you inserting straight values or are you ... Run a .NET performance profiler to see exactly ... call ExecuteNonQuery on command obj associated to connection. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: TADODataset VERY Slow With MS SQL
    ... We've built applications in Delphi ... > application to Delphi 7 with MS SQL using TADODataset, ... > file and 2 details files containing payment status) as separate record sets ...
    (borland.public.delphi.database.ado)
  • Re: Codegear sold
    ... It dicovered and properly recognized MS SQL and IBM DB servers at my ... It is not a delphi app. ... Empty app takes about 50Mb. ... It asociates sql and eqb extensions. ...
    (borland.public.delphi.non-technical)
  • RE: SBS2003 Standard - managing the SQL installation?
    ... information for how to use SQL command line for MSDE 2000: ... 325003 How To Manage the SQL Server Desktop Engine (MSDE 2000) by Using the ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • Re: How to get the last insert id
    ... SQL Server does have Scope_Idendity, ... so if someone else is also inserting data to ... Session 1 inserts a new employee: ... Commit complete. ...
    (comp.databases.oracle.misc)