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

How do I validate dynamic sql?

Status
Not open for further replies.

jaol

Programmer
Oct 16, 2003
13
DK
Hi,

Im trying to update several records in my Access-database through an ASP-page. The SQLsentence is build dynamicly for each record.
If the UPDATE gives an error, I dont get the message, and everyting stops without warning me.

How can I validate my SQL before executing or how do I get the error-message on my screen?

Thanks for all your help
 
So when you say everything stops, what exactly do you mean? Is it just that your page is blank? DO you not get a message in IE, or whatever browser you are using?

Whean I was building my code for SQL access not too long ago, I got error 500 in IE every time I had a problem whether on UPDATE, badly formed SQL, or anything at all to do with SQL and access to the access-db. What I did in this instance was check the of my web-server (local dev machine), and I could see exactly where things were going wrong, line-numbers and all.

Is that waht you are looking for? If not, perhaps you could explain a little more...

Will
[morning]
 
Might try the ASP Forum. Sounds like someplace where error trapping might come in though - if not script debugger.
 
Let me try to explain.

I build a INSERT-sql-sentence while i'm looping through a recordset.

If this sql-sentence is wrong I am not getting an error from the server.

If I write this wrong sql-sentence in Access, I can see the problem, because I am trying to update the same field twice in one statement.

What I am looking for is a way to validate this sql-sentence before executing it.
Or just get a message from the server, notifying me that something has gone wrong.

Janne
 
What are you using, DAO or ADO or ... ?
If you want some accurate help post some relevant code.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top