Re: Delete Query

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Is there something running prior to this that is locking the table? You
could try closing the table via code first...

Just a thought,

Susan

"dallin" <dallin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2DD59266-7C7D-487B-A2EC-91CF26A1C5C8@xxxxxxxxxxxxxxxx
> Thank you - your reponse was right on -- however, I am getting an
> additional
> error that says "Could not delete from specified tables. (Error 3086)
> You tried to delete data from one or more tables, but the deletion could
> not
> be completed." I've checked the permissions?
>
> --
> thanks, mc
>
>
> "Steve Schapel" wrote:
>
>> MC,
>>
>> A Delete Query needs to have the table specified. The SQL always looks
>> like this...
>> DELETE TableName.* FROM ...
>>
>> It is not clear what you are trying to achieve with the Left Join. This
>> would appear to indicate that you have records in the 2_073105 table
>> which do not have corresponding records in the Almost table. Is that
>> right? And in that case, the data returned by the query will include
>> these records, right? So how do the non-existent Almost records relate
>> to what you are trying to achieve, if you catch my drift here? Are you
>> really trying to delete all records from the Almost table where there
>> *are* matching records in the 2_073105 table? If so, the SQL would be
>> like this...
>> DELETE ALMOST.*
>> FROM ALMOST INNER JOIN 2_073105
>> ON ALMOST.[Well No]=[2_073105].QEP
>>
>> Otherwise, if I have misunderstood, please try to explain what you want
>> to happen.
>>
>> --
>> Steve Schapel, Microsoft Access MVP
>>
>>
>> dallin wrote:
>> > Below is the sql statement. Thanks.
>> >
>> > DELETE ALMOST.Co, ALMOST.ST, ALMOST.[Opr #], ALMOST.[Well No],
>> > ALMOST.Operator, ALMOST.[Well Name], ALMOST.[Prod Date],
>> > ALMOST.[Current Gas
>> > Imb], ALMOST.[Prior Mo Gas IMb], ALMOST.Status, ALMOST.[Stmt Mailed],
>> > ALMOST.[DOM requests], ALMOST.PIPELINE, ALMOST.Purchaser,
>> > ALMOST.SYSTEM,
>> > ALMOST.GWI, ALMOST.[Last Request], ALMOST.Comments, ALMOST.[P&A/Sell
>> > Form],
>> > ALMOST.[P&A/Sell Form to Acctg], ALMOST.GBA, ALMOST.[MAKE-UP],
>> > ALMOST.[TERMS
>> > FOR GBA], ALMOST.County, ALMOST.[LEGAL DESCRIPTION], ALMOST.ACQ,
>> > ALMOST.[SOLD
>> > DATE], ALMOST.[SOLD TO], ALMOST.[FILE LOCATION], ALMOST.Reserves,
>> > ALMOST.ID
>> > FROM 2_073105 LEFT JOIN ALMOST ON [2_073105].QEP = ALMOST.[Well No];
>> >
>>


.



Relevant Pages

  • Re: Why db.OpenRecordset("SQL STRING HERE", dbOpenDynaset) is not working ?
    ... Sub Tester() ... Dim r As Recordset ... FROM tblBatches INNER JOIN (tblClusters INNER JOIN ((tblAdmin INNER ... you have a where statement that looks the same as the where statement in your SQL statement. ...
    (comp.databases.ms-access)
  • Re: Slow GROUP BY
    ... ' 'create primary key ... PunchList INNER JOIN Lot ON PunchList.LotId = Lot.Id INNER JOIN PunchItem ON ... the exact schema of the parent and child table ... your exact SQL statement that includes the GROUP BY ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: "Where" column limits records regardless of row
    ... inner join and none of the four fields used have any null values. ... GROUP BY., [qry SAME STORES IN IPT ... > If neither of those issues apply, post the SQL statement (SQL View on View ...
    (microsoft.public.access.queries)
  • SQL and recordset.Open (still having problems)
    ... SELECT ACCOUNT_LIST.COMPLEMENTOR FROM REP_LIST INNER JOIN ... I have the SQL statement variable declared as: ... >> strsearch variable. ... The error is telling you that the SQL command is ...
    (microsoft.public.access.modulesdaovba)
  • DDL query to add new fields to existing table
    ... Is it possible to use a SQL statement to copy x number of fields from table ... Thus the query needs to select x number of fields from table A and copy the ... unknown field 'CoPayFundGrant'......". ... place the original data in it. ...
    (microsoft.public.access.queries)