not updateable field

  • Thread starter Thread starter Tomba
  • Start date Start date
T

Tomba

Guest
I'm sort of getting desperate here with this query :(
I really hope someone can help me out...

I made an insert query in my table LID, and it works perfectly... (unless Date() doesn't seem to fill something into a date field.. if anyone knows why... :p )

But then I also made an update query on that table, but unfortunately that doesn't work :(
I get this error:

the field (text(50) ) on which the error comes is not a autonumber field,
but in fact the first I update (located after my autonumbered index field)
Cannot update <field name>; field not updatable. (Error 3113)
the explanation in the help files means few to me :(
so can anyone guess what the problem may be and how I could resolve it?

thanks a lot!
 
Please post the SQL statement of your query (i.e. the whole statement in the SQL View of the query.)
 
here it is, my thingy that won't execute (error on Lidnaam - field)


PARAMETERS LID_id Long, Lidnaam Text ( 50 ), lidvrnm Text ( 50 ), Lidnaam2 Text ( 50 ), lidvrnm2 Text ( 50 ), Straat Text ( 50 ), PC_id Long, Tel_thuis Text ( 15 ), Fax_thuis Text ( 15 ), Tel_werk Text ( 15 ), Fax_werk Text ( 15 ), GSM Text ( 15 ), Email Text ( 50 ), geslacht Text ( 1 ), Reknr Text ( 14 ), username Text ( 50 ), [password] Text ( 50 );
UPDATE LID SET Lidnaam = [lidnaam], lidvrnm = [lidvrnm], lidnaam2 = [lidnaam2], lidvrnm2 = [lidvrnm2], Straat = [Straat], PC_id = [PC_id], Tel_thuis = [Tel_thuis], Fax_thuis = [Fax_thuis], Tel_werk = [Tel_werk], Fax_werk = [Fax_werk], GSM = [GSM], Email = , M_V_code = [geslacht], Reknr = [Reknr], username = [username], [password] = [password]
WHERE LID_id=[LID_id];

thank you a lot in advance!
 
I have difficulty trying to understand your question.

You said "I made an insert query ... Date() doesn't seem to fill something into a date field". But the query that you posted is actually an UPDATE query. (An Insert query is for adding new records to a table, while an Update query is for modifying existing records in a table. They are different.)

Besides, I can't find any date field in the fields that you listed.


In your Update query you declared 17 parameters but 16 of them had the same names as the field names. Parameters are place-holders for user input. We do not use field names for parameters.

If you do not need to prompt for user input when the update query is run, you don't need to use parameters. However, if you do need to prompt for user input for each field, you must name the parameters different from the field names. For example, if you want to prompt the user for a new email address for LID_id=10, you can use this update query to modify the record:-

UPDATE LID SET Email = [Enter a new email address:]
WHERE LID_id = 10

(Note. I have used only one parameter and I have even ignored its data-type declaration.)


However, if what you want is add new records to the table, instead of using an Insert query with a parameter for each field, you can use the create form wizard to create a user-friendly input form.

In the input form, you can set the Default Value of the text box for the date field to Date(), so that any new records will have today's date automatically filled in.

Hope this helps.
 
But then I also made an update query on that table, but unfortunately that doesn't work
I get this error:

So I was not at all saying I would post an insert query, because that works perfectly!

Even more.. in that WORKING insert query, I also use the same parameternames, and that query works perfectly... why can't I use the same in this query then?

Unfortunately a form would be useless as I need a stored procedure to be able to access it from an ASP page.

greets,
Tomba
 

Users who are viewing this thread

Back
Top Bottom