Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Microsoft JET Database Engine (0x80040E10
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Microsoft JET Database Engine (0x80040E10

 Post Reply Post Reply
Author
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Topic: Microsoft JET Database Engine (0x80040E10
    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.

Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post 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
Soft 4 web
Back to Top
Flamewave View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 June 2002
Location: United States
Status: Offline
Points: 376
Post Options Post Options   Thanks (0) Thanks(0)   Quote Flamewave Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.