SQL Problem

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
LVL 3
harris9999Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
gladxmlConnect With a Mentor Commented:
harris9999,

Try to check if the Telephone & Fax is a text data type.
0
 
gladxmlCommented:
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
 
sybeCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
harris9999Author Commented:
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
 
harris9999Author Commented:
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
 
gladxmlCommented:
0
 
harris9999Author Commented:
maybe it has something to do with the space in the postcode?
0
 
harris9999Author Commented:
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
 
gladxmlCommented:
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
 
harris9999Author Commented:
Just had the same idea as you, after lookin at that webpage. Cheers
0
 
sybeCommented:
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
 
gladxmlCommented:
harris9999,

Glad to be of help...

Good luck on your project...

Happy programming...
0
All Courses

From novice to tech pro — start learning today.