By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,162 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,162 IT Pros & Developers. It's quick & easy.

Error on SQL Insert Statement

P: 8
I am using IIS on Windows 7 Enterprise.
The following lines of code are an asp page with vbscript calling a MySQL database.

Expand|Select|Wrap|Line Numbers
  1. <!--#INCLUDE file="header.asp"-->
  2. <html>
  3. <%
  4.  
  5.     iRegion=request.querystring("fRegion")
  6.     response.write iRegion & "<br/>"
  7.     Set myConnection = Server.CreateObject("ADODB.Connection")
  8.     myConnection.ConnectionString = "driver={MySQL ODBC 5.3 Unicode};" & _
  9.         "server=localhost;" & _
  10.         "uid=myUser;" & _
  11.         "pwd=myPassword;" & _
  12.         "database=myDB;"
  13.     response.write myConnection.ConnectionString & "<br>"
  14.     myConnection.open "GenixSQL"
  15. %>
  16.  
  17. <head>
  18.     <meta http-equiv="Content-Language" content="pt">
  19.     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  20.     <title>Testes de Inserção</title>
  21. </head>
  22.  
  23. <body  bgcolor="#000000" link="#66CCFF" vlink="#CC66FF" alink="#FFCC99" text="#66CCFF">
  24.     <!-- TEST -->
  25.     <h3 align="center">Insertion Test: MySQL56 Instance</h3><br>
  26.     <%
  27.     insRegion = "INSERT INTO TESTE (testeDS) VALUES ('" + iRegion + "')"
  28.     myConnection.Execute insRegion
  29.     response.write insRegion & "<br/>"
  30.     set myConnection = Nothing
  31.     myConnection.close
  32.     %>
  33.     <a href="index.htm">Home Page</a>
  34. </body>
  35. </html>
When running the asp page I get a very generic error message "An error occurred on the server when processing the URL. Please contact the system administrator."

Despite the error the database is updated.

Could anyone help please.

Thank you in advance.
Aug 14 '14 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 1,035
The webserver should have create a log file, did you have a look in the log file?

What is returned to the browser? For debugging purposes Fidller it the tool to use
Aug 16 '14 #2

P: 8
The following is returned by the web browser:


------------------------------------------
New York
Insertion Test: MySQL56 Instance


INSERT INTO TESTE (testeDS) VALUES ('New York')
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
--------------------------------------------------

I can see that the variable fRegion="New York" is returned by the form and the variable iRegion=fRegion is present in the Insert statement. I check the database and the value "New Youk" has been added but still the same error.
Aug 17 '14 #3

Expert 100+
P: 1,035
i'm sorry, i don't do stuff with asp, and this seems to be an asp error.
Aug 17 '14 #4

P: 8
Thanks anyway.
I found the error:
I removed
set myConnection = Nothing
and it is working without error.
Aug 17 '14 #5

Post your reply

Sign in to post your reply or Sign up for a free account.