Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DELETE From problem

Status
Not open for further replies.

JohnnyT

Programmer
Jul 18, 2001
167
GB
Hi,

I'm designing an application using some software from a company called Citect. The software uses there own code called CiCode which is a cross between C and VBA script (I've been told).

The application I'm designing talks to a .mdb access database and I'm trying to write the function that deletes a record based on a variable called RecNo.

I have tried the following lines:
sSQL = "DELETE FROM pallet_formats WHERE PROG_NO='RecNo'";

sSQL = "DELETE FROM pallet_formats WHERE PROG_NO=RecNo";

sSQL = "DELETE FROM pallet_formats WHERE PROG_NO='" + RecNo + "'";

But without success... HOWEVER if I write:
sSQL = "DELETE FROM pallet_formats WHERE PROG_NO='3'";

It will delete Record No 3.

This tells me that the rest of my code is fine, but there is a problem with the software seeing RecNo as a number. Maybe it is literally looking for the word "RecNo" in the PROG_NO field??

Has anyone any idea's on how to write this?

Thanks in advance, I'm tearing my hair out over here and, as is usual, Citect Tech Support promised to ring me back, didn't, haven't answered the email either, and now they've closed for the weekend. Grrr!

Cheers

JT :)


I don't make mistakes, I'm merely beta-testing life.
 
sSQL = "DELETE FROM pallet_formats WHERE PROG_NO='"&RecNo&"'";

-DNG
 
DNG

Thanks mate. I just sussed it a few minutes ago. I had the database field PROG_NO set to TEXT so I changed this to NUMBER.

I then changed the code to:
sSQL = "DELETE FROM pallet_formats WHERE PROG_NO="+RecNo+"";

And it seems to work.

Many thanks for your help mate

Cheers

JT :)

I don't make mistakes, I'm merely beta-testing life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top