Problem reading from database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Toco

    #1

    Problem reading from database

    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?
  • Cor Ligthert [MVP]

    #2
    Re: Problem reading from database (FoxPro)

    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" <Toco@discussio ns.microsoft.co mschreef in bericht
    news:A81DF609-C54A-40C5-AAD0-EF624AF5464E@mi crosoft.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?

    Comment

    • Cindy Winegarden

      #3
      Re: Problem reading from database (FoxPro)

      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
      cindy@cindywine garden.com


      "Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
      news:O4cKmZynGH A.4172@TK2MSFTN GP03.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" <Toco@discussio ns.microsoft.co mschreef in bericht
      news:A81DF609-C54A-40C5-AAD0-EF624AF5464E@mi crosoft.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?
      >
      >

      Comment

      Working...