Print Page | Close Window

Microsoft JET Database Engine (0x80040E10

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6936
Printed Date: 31 March 2026 at 12:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Microsoft JET Database Engine (0x80040E10
Posted By: ngaisteve1
Subject: Microsoft JET Database Engine (0x80040E10
Date Posted: 02 November 2003 at 8:29pm

When I run this code, I this error message.

Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.

The code is below:

strcounter = 1
do while not rs.eof
conn.execute "update customer set custID = " & strCounter & " "
strCounter = strCounter + 1
rs.movenext
loop

My existing table do not have incremental no as primary key. That's why I thought about having this code to add those number as primary key.

How do I fix it? Thanks.




Replies:
Posted By: zaboss
Date Posted: 02 November 2003 at 11:27pm

First of all, not using the database function it is stupid. What about you have two simultaneous entries which will get them the same ID which might cause you some real problems.

As for the error you need to check the spelling of the names, the data type, things like that usually trigger this error.



-------------
Cristian Banu
http://www.soft4web.ro - Soft 4 web


Posted By: Flamewave
Date Posted: 03 November 2003 at 2:51pm

Something like this may work too:

conn.execute "insert into customer (custID, column1, column2) (select MAX(custID) + 1, 'value1', 'value2' from customer)"

Where I have 'value1' and 'value2' you can put any text you want, just make sure its properly formatted for sql insertion. So for example you could have two variables storing the data you want to put into column1 and column2, and your insert statement would look like this:

conn.execute "insert into customer (custID, column1, column2) (select MAX(custID) + 1, '" & replace(var1, "'", "''") & "', '" & replace(var2, "'", "''") & "' from customer)"

of course, this methood will only work upon insertion, not when updating.



-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.


Posted By: ngaisteve1
Date Posted: 03 November 2003 at 9:46pm
I got that solve, just by creating a datatype autonumber and then the autonumber automatically added into the table. I didn't realize it is that easily. Anyway, thanks for you guys for helping.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net