By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

Problem reading from database

P: n/a
Hello. I have app written in C# that we are testing. The executable is
shared on our network. The method we are testing is a call to a foxpro
table. The call is made to query the table, then fill a datable with the
resultset. All is fine when I run the executable from my machine. However,
when our test user runsthe same executable, the app errors out when
attempting to read from the foxpro table. I have logged where the user
connects to the database, but a rather unhelpfull error dialog is returned:
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt. I have narrowed this error occuring at the
data-adapter.FILL method(data-table). What I'm at a loss is why the error
occurs while our user tests this method, yet does not fail when I test. I
have ensured that our user has .NET 2.0 and has READ permission for the fox
pro table.

Any thoughts or ideas, something missing that is required for foxpro or ADO?
Jul 3 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Toco

I changed the subject and trying to make this visible to the FoxPro guys and
especially girls.

You can try this as well in a FoxPro newsgroup, there are very much people
active who know about Net programming.

Cor
"Toco" <To**@discussions.microsoft.comschreef in bericht
news:A8**********************************@microsof t.com...
Hello. I have app written in C# that we are testing. The executable is
shared on our network. The method we are testing is a call to a foxpro
table. The call is made to query the table, then fill a datable with the
resultset. All is fine when I run the executable from my machine.
However,
when our test user runsthe same executable, the app errors out when
attempting to read from the foxpro table. I have logged where the user
connects to the database, but a rather unhelpfull error dialog is
returned:
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt. I have narrowed this error occuring at the
data-adapter.FILL method(data-table). What I'm at a loss is why the error
occurs while our user tests this method, yet does not fail when I test. I
have ensured that our user has .NET 2.0 and has READ permission for the
fox
pro table.

Any thoughts or ideas, something missing that is required for foxpro or
ADO?

Jul 4 '06 #2

P: n/a
Thanks Cor!

Toco,

It really helps to post your connection string and the code you are using.
Also, be sure the user has the latest FoxPro and Visual FoxPro OLE DB data
provider, downloadable from msdn.microsoft.com/vfoxpro/downloads/updates .

If you write a really simple (console) app to access a single table do you
have this problem? Does it occur on any particular table or on all of them?
What is the data structure of your table? Does it happen if you make a
really simple DBF and work against that table? ( sqlCommand = "Create Table
MyTable (Field1 I, Field2 C(10))" )

This error appears to be a .NET error and is not limited to accessing FoxPro
tables. A Google search on "Attempted to read or write protected memory"
brought up a lot of threads, and if you go over these you may find something
that fits your situation. Among the suggestions is that .NET doesn't work
correctly with some data types and also that uninstalling/reinstalling the
..NET framework may help. I haven't seen a concrete answer that is a total
fix for the issue.

--
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
ci***@cindywinegarden.com
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:O4**************@TK2MSFTNGP03.phx.gbl...
Toco

I changed the subject and trying to make this visible to the FoxPro guys
and especially girls.

You can try this as well in a FoxPro newsgroup, there are very much people
active who know about Net programming.

Cor
"Toco" <To**@discussions.microsoft.comschreef in bericht
news:A8**********************************@microsof t.com...
>Hello. I have app written in C# that we are testing. The executable is
shared on our network. The method we are testing is a call to a foxpro
table. The call is made to query the table, then fill a datable with the
resultset. All is fine when I run the executable from my machine.
However,
when our test user runsthe same executable, the app errors out when
attempting to read from the foxpro table. I have logged where the user
connects to the database, but a rather unhelpfull error dialog is
returned:
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt. I have narrowed this error occuring at the
data-adapter.FILL method(data-table). What I'm at a loss is why the
error
occurs while our user tests this method, yet does not fail when I test.
I
have ensured that our user has .NET 2.0 and has READ permission for the
fox
pro table.

Any thoughts or ideas, something missing that is required for foxpro or
ADO?


Jul 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.