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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting rows

Status
Not open for further replies.

dauzat

MIS
Aug 16, 2001
2
US
Hey, this might sound like a stupid question, but I am new to ASP. I have made a site that is used to list job openings. In order for the user to delete the job opening after the position is taken, I have set up an ID number that Access 2000 assigns automatically. The problem is, I can't set it up to delete by this ID number. Can anyone please help me? Here is the code I am using

*** Declaring variables ***
Dim strID, SQLStmt, con, data_source

*** Receiving values from Form ***
strID = Request.Form("ID")

*** Creating Connection Object and opening the database ***
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("../../database.mdb")
SQLStmt = "DELETE DISTINCTROW strID FROM employment WHERE (strID ='" & strID & "')"
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute SQLStmt
 
Try this:
Code:
SQLStmt = "DELETE FROM employment WHERE (strID ='" & strID & "')"
That should work. If it doesn't, then post the exact error you are recieving. In the future be sure to always post the error message, otherwise it is harder for us to help. Wushutwist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top