Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reserved Error (-1517) 1

Status
Not open for further replies.

HokieFan

Programmer
Mar 7, 2001
3
US
I received the following error message:

Run-time error '3000':
Reserved Error (-1517);there is no message for this error.

Clicking "Help" reveals that there is no help for this error.

Here is the code that produces the error:
dim db as Database
dim rst as Recordset
dim strName as String
dim lngID as Long

...(strName & lngID are assigned a value based on some logic - in this case "Sat" & 10866)...

Set db=CurrentDB
Set rst=db.OpenRecordset("tbl_" & strName)
rst.AddNew
rst.Fields("ID")=lngID

And that's where the error occurs. The data type for that field is Long Integer. There are other fields that are assigned data after this line that work fine (after I move that yellow arrow down a line in the debug window).

Can someone tell me what these Reserved Errors are, especially this one in particular?

Thanks,
Bill

 
Reserved Errors are ones where those helpful people at MS allocate the number to an event ( reserve it ) and then never got round to writing the code to support it.


a field name ending in ID usually means it is a Primary Key
You say this field is of type Long Int.
Could it have the Index setting to NoDuplicates ?

You've obviously typed the code in to this board rather than cut and pasting it - so are you absolutly sure there are no typos in the module code ?



Try replacing the offending line with

rst!ID = 10866

and then see if that runs.
If it does not then you might get a more helpful Error Code.



G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
LittleSmudge - Thanks for your help!

Yes, that field is the Primary Key, but it doesn't appear to be trying to add a duplicate value. Plus, I'd expect to get a regular Access message if I tried that.

You're right, I should have copied/pasted the code. I re-checked, though, and no typos.

Your third suggestion was a winner - but I'm not sure why. Rather than replacing the code, I added that line immediately above the line giving me the error, so that it initially assigns a "dummy" number to the field and then immediately assigns the real value. Now it works perfectly - no more errors. I just don't know why.

I'm a bit worried rolling this database out to users without knowing the root cause of the error, since I don't know if I've cured it for good! Looks like a few more gray hairs I can attribute to Microsoft!

Thanks again for your suggestions,
Bill


 
Then the next thing to look at is the "assignment logic" that sets strName = 10866

If it involves an integer to String conversion then you could be ending up with an unwanted leading space character.

Code:
strName = " 10866"
rather than
Code:
strName = "10866"

On that case you'll need

strName = Trim(assignment Logic) to get rid of the space.




'ope-that-'elps.


G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top