Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 14th, 2005, 11:29 AM
DocX DocX is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 1 DocX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to DocX
Errors when adding record with ADO.

Hello All!

I'm getting errors 3265 and -2147217900 when adding records through ADO. The problem is that it's not happening consistently. When adding records, sometimes it'll error 3265 on the 8th one, then the 3rd one. It'll do it on around the 3rd record entered for a couple more times after it does it on the 8th one and then either crash out completely OR give me an error -2147217900 and then crash out either right after that error or after another few records are entered. Sometimes it'll give this -2147217900 error right off the bat with the first added record. It's seemingly random. But there has to be method to this madness. Also of note is the fact that, once one of these errors occur, I can go ahead and add the record it just gave the error on, assuming it doesn't crash right after the error.

Error 3265 is: Item cannot be found in the collection corresponding to the requested name or ordinal.

Error -2147217900 is: Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or UPDATE'.

I'll tell afterwards which error occurs where. There's a lot more to the procedure, but here's the ADO code that's adding the record:
Code:
Set rst = New ADODB.Recordset
rst.Open "LaborCost", CurrentProject.Connection, adOpenForwardOnly, adLockPessimistic
With Me
	rst.AddNew Array("Date", "EmployeeNo", "RegularHoursWorked", "OvertimeHoursWorked", _
	"HolidayPay", "Justification", "Comments", "PayRate", "OTPayRate", "MineNo", _
	"Section", "Shift", "TrainType", "TrainHours"), _
	Array(.Date, .cboEmployeeNo, .RegularHoursWorked, .OvertimeHoursWorked, .HolidayPay, _
	.cmbJustification, .Comments, .txtPayRate, .txtOTPayRate, .cmbMineNo, .txtSection, _
	.txtShift, .cmbTrainType, .txtTrainHours)
End With
rst.Update
rst.Close
Set rst = Nothing


Error 3265 occurs in the rst.AddNew command. Error -2147217900 occurs in the rst.Open command.

Sorry for the lengthy message. Thank you much in advance! If you need any info on the data types of any of the fields, let me know. Consistent problems are doable...inconsistent problems are stomach twisting.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Errors when adding record with ADO.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway