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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in prog when it hits rs([field name]).value: Write Violation

Status
Not open for further replies.

XJ900

Technical User
Apr 13, 2007
27
US
I have a program that is supposed to access a ms access database, pull the information, and then post it to a MSOWC spreadsheet.

If I run the code from VB6 it works fine, but when I compile it it crashes with an "unhandled exception...Access violation writing location..."

When I debug the program it looks like the error is happening when it tries print the recordsource (rs) with the .value command at the end (rs("[field name]").value). If I kick .value out of the code it gets hung up on the next .value line. Can anyone tell me why it does this in the .exe and how to fix it or work around it?

Thanks
 
Looking at it again, I think it crashes every time it tries to look up a field in the record source.
 
hmm.

Recordsource = property that defines where a record is coming from in an ADO Data Control. I assume you mean recordset.

I would take the error message literally. You imply that the error occurs when you attempt to read something, and that's not what it says. What are you trying to write, and where? Identify that, and you'll be on the way to fixing your problem.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top