473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Error on SQL Insert Statement

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
4 1764
Luuk
1,047 Expert 1GB
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
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
Luuk
1,047 Expert 1GB
i'm sorry, i don't do stuff with asp, and this seems to be an asp error.
Aug 17 '14 #4
Thanks anyway.
I found the error:
I removed
set myConnection = Nothing
and it is working without error.
Aug 17 '14 #5

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

Similar topics

2
by: mvr | last post by:
Hi all I are using IIS 5.0, Oracle 8.1. I am having problem with the following Insert Statement when used on Production Web server with SSL(https://...., Verisign). This doesn't occur...
6
by: Kathy Burke | last post by:
Ugh. I'm using the following in an asp.net. I get an Syntax Error in INSERT INTO Statement on line Cmd1.ExecuteNonQuery(). I've made all my database fields text (just to eliminate that as a...
2
by: eric dugal | last post by:
Hi all!! I need your help.... i'm working since 2 hours on a simple insert statement, but couldn't handle it. Here is my code : public int ExecQuery(string SqlString) {
2
by: Tim::.. | last post by:
Can someone please tell me why I keep getting the following error from the code below! Error: INSERT statement conflicted with COLUMN FOREIGN KEY constraint...
2
by: Paul Mason | last post by:
Hi folks, The ado.net stream appears to be not working so I'm here. The following function generates the error "Operation must use an updateable query". There is no identifiable or meaningful...
2
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
7
by: Cindy H | last post by:
Hi I'm having a problem getting the insert statement correct for an Access table I'm using. The Access table uses an autonumber for the primary key. I have tried this: INSERT INTO Tournaments...
2
by: John | last post by:
The ASP application inserts transaction records in transaction table with the system time as the primary key. However, it is possible to have primary key violation because the records in...
6
by: BaWork | last post by:
I have the following to insert a new record: <% .. Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "DSN=qqqqq;" SQLStmt = "INSERT INTO tbl_qqqqqq (main_cat, cat_fee, fee_amount)...
3
by: DontB3 | last post by:
Hi, I'm new in this forum, and i hope someone can help. I'm creating an automatic application that transfer a database from Access -> DBF -> Oracle. When My App try to execute Insert SQL...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.