?
Solved

SQL Problem

Posted on 2003-03-11
12
Medium Priority
?
542 Views
Last Modified: 2012-06-21
I am getting the following Error when trying to insert into a database.  

Microsoft JET Database Engine error '80040e57'

Overflow

/moyledc/cp/businessprocess.asp, line 25

This line is the line where it it trying to execute the SQL statement.  My Code is:

<%
dim category, name, address, town, postcode, telephone, fax, website, email, cn, strSQL
category=request.form("category")
name=replace(request.form("name"),"'","''")
address=replace(request.form("address"),"'","''")
town=replace(request.form("town"),"'","''")
postcode=replace(request.form("postcode"),"'","''")
telephone=request.form("telephone")
fax=request.form("fax")
website=replace(request.form("website"),"'","''")
email=replace(request.form("email"),"'","''")              
set cn = server.createobject("ADODB.Connection")
cn.provider = application("strProvider")
cn.open application("strConBusiness")
strSQL = "INSERT INTO Business (Category, Name, Address, Town,  Postcode, Telephone, Fax, Website, Email)" _
& "VALUES('" & category & "','" & name & "','" & address & "','" & town & "','" & postcode & "','" & telephone & "','" & fax & "','" & website & "','" & email & "')"
cn.execute(strSQL)
cn.close
set cn = nothing
%>  

Any of you got any idea's
0
Comment
Question by:harris9999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
12 Comments
 
LVL 15

Expert Comment

by:gladxml
ID: 8109999
harris9999,

Do a response.write on your strSQL and chek the result on the browser... and post the result.. also try to remarks the execute command
0
 
LVL 28

Expert Comment

by:sybe
ID: 8110006
do a response.write strSQL, and post the result pls

strSQL = "INSERT INTO Business (Category, Name, Address, Town,  Postcode, Telephone, Fax, Website, Email)" _
& "VALUES('" & category & "','" & name & "','" & address & "','" & town & "','" & postcode & "','" & telephone & "','" & fax & "','" & website & "','" & email & "')"

Response.write strSQL & "<br>"

probably one of the values does not fit in the table field.
0
 
LVL 3

Author Comment

by:harris9999
ID: 8110012
this is the result of the SQL

INSERT INTO Business (Category, Name, Address, Town, Postcode, Telephone, Fax, Website, Email)VALUES('education','Cross and Passion','54 Main Street','Ballycastle','BT56 6UJ','02854678093','02854872930','http://www.crossandpassion.com','cross@passion.com')
Microsoft JET Database Engine error '80040e57'

Overflow

/moyledc/cp/businessprocess.asp, line 25
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:harris9999
ID: 8110016
this is the result of the SQL

INSERT INTO Business (Category, Name, Address, Town, Postcode, Telephone, Fax, Website, Email)VALUES('education','Cross and Passion','54 Main Street','Ballycastle','BT56 6UJ','02854678093','02854872930','http://www.crossandpassion.com','cross@passion.com')
Microsoft JET Database Engine error '80040e57'

Overflow

/moyledc/cp/businessprocess.asp, line 25
0
 
LVL 15

Expert Comment

by:gladxml
ID: 8110018
0
 
LVL 3

Author Comment

by:harris9999
ID: 8110022
maybe it has something to do with the space in the postcode?
0
 
LVL 15

Accepted Solution

by:
gladxml earned 200 total points
ID: 8110037
harris9999,

Try to check if the Telephone & Fax is a text data type.
0
 
LVL 3

Author Comment

by:harris9999
ID: 8110043
Got the Error. I had the telephone and Fax field set as numbers, and it was too large for the field. Just changed it to Text.  Cheers for the help Lads.  You'll get the points gladxml.
0
 
LVL 15

Expert Comment

by:gladxml
ID: 8110049
harris9999,

To isolate the column that is causing the problem.. what you can do is to test each field using your script and do a trial and error to get to the exact column that is overflowing...

HTH...

HAppy programming...
0
 
LVL 3

Author Comment

by:harris9999
ID: 8110051
Just had the same idea as you, after lookin at that webpage. Cheers
0
 
LVL 28

Expert Comment

by:sybe
ID: 8110052
copy the querystring and try it in Access itself, it gives better error messages:

- open database
-got to "queries" (under "tables")
-click on "new"
-choose "design view"
-on the "choose table" dialog -> click close immediately
-get the SQL by clicking on "SQL" right under the "file" option in ACCESS (top left of total screen)
-now copy & paste you strSQL in it query
-push on "run" (the red ! (exclamation) icon)

- read the error message
0
 
LVL 15

Expert Comment

by:gladxml
ID: 8110057
harris9999,

Glad to be of help...

Good luck on your project...

Happy programming...
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question