• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 118
  • Last Modified:

Error running delete query

Hi,

I'm getting an error on the line of code given, any ideas why - syntax seems fine?

Thanks,
Uni
Set lessonTable = databaseConnection.OpenRecordset("DELETE * FROM StudentLesson WHERE IsLessonTypePlanned=TRUE AND LessonPlanID=" & lstLessonPlans.ItemData(lstLessonPlans.ListIndex) & " AND LessonStatus=8")

Open in new window

0
Unimatrix_001
Asked:
Unimatrix_001
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
several things: DELETE does not open a recordset... so use execute instead of openrecordset
next, what is the database? I assume access?
next, waht is the data type of IsLessonTypePlanned and LessonPlanID?

finally, what is the EXACT error message, please?
0
 
Unimatrix_001Author Commented:
Thanks,
Uni
0
 
Unimatrix_001Author Commented:
Thought it was quite strange returning a recordset - execute works fine, thanks! :-)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now