|
Dynamic SQL is what's wrong with it. You have code that writes code. We don't know if it's the code you've written and shown us above, or the code that it writes, which is even causing the problem! It could easily be that one of the string values you're trying to insert has a ' in it, or some other character with a special meaning. It could be the wrong type delimiter all together. Or something entirely different.
The solution to this particular problem is to save an "action query" to your Access database, and parametrize it. Then bind your ASP code to those parameters.
That may or may not get the code above working the way you'd expect, but if you had taken that approach, right now you would know whether it's a database problem or an ASP AJAX problem. Or, rather, once you'd tested your "action query", you would know that wasn't the source of the problem. (And if it is, that would mean you'd have no problem at all!)
Server.MapPath is better than a fully qualified path for somewhat similar reasons. If the file doesn't exist in that location, it would break your code. If, instead, you issued a call to open Server.MapPath("~/Data/WebData.mdb") besides just being easier, if your site was moved on the physical disc and IIS was updated, things would still just work.
|