Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MS Access Problem

MS Access Problem

Scheduled Pinned Locked Moved C#
helpquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Star09
    wrote on last edited by
    #1

    OleDbConnection clsConnection;
    clsConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\.one.mdb;");
    clsConnection.Open();
    //first table
    WTest1.oneDataSet f_table = new WTest1.oneDataSet();
    OleDbDataAdapter dAdapter = new OleDbDataAdapter("select * from first", clsConnection);
    dAdapter.Fill(f_table, "first"); // runtime error incorrect FROM syntax
    clsConnection.Close();

    I've used this code in a previous application and it worked fine, however in this application, it's giving me this error about FROM syntax. Can someone please tell me what's wrong??:confused: Star

    M L 2 Replies Last reply
    0
    • S Star09

      OleDbConnection clsConnection;
      clsConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\.one.mdb;");
      clsConnection.Open();
      //first table
      WTest1.oneDataSet f_table = new WTest1.oneDataSet();
      OleDbDataAdapter dAdapter = new OleDbDataAdapter("select * from first", clsConnection);
      dAdapter.Fill(f_table, "first"); // runtime error incorrect FROM syntax
      clsConnection.Close();

      I've used this code in a previous application and it worked fine, however in this application, it's giving me this error about FROM syntax. Can someone please tell me what's wrong??:confused: Star

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      are you sure there is table called 'first' and also do you have 2 spaces between 'from' and 'first'. Im sure queries don't like double spaces

      Life goes very fast. Tomorrow, today is already yesterday.

      1 Reply Last reply
      0
      • S Star09

        OleDbConnection clsConnection;
        clsConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\.one.mdb;");
        clsConnection.Open();
        //first table
        WTest1.oneDataSet f_table = new WTest1.oneDataSet();
        OleDbDataAdapter dAdapter = new OleDbDataAdapter("select * from first", clsConnection);
        dAdapter.Fill(f_table, "first"); // runtime error incorrect FROM syntax
        clsConnection.Close();

        I've used this code in a previous application and it worked fine, however in this application, it's giving me this error about FROM syntax. Can someone please tell me what's wrong??:confused: Star

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Star09 wrote:

        Data Source=C:\\.one.mdb

        do you need the first period? :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in


        S 1 Reply Last reply
        0
        • L Luc Pattyn

          Star09 wrote:

          Data Source=C:\\.one.mdb

          do you need the first period? :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in


          S Offline
          S Offline
          Star09
          wrote on last edited by
          #4

          I have removed the path because it was so long, but I do have it in my application, lol. As for the double spaces, didn't notice them, thanks, but still even though I removed the double spaces, still same runtime error

          M 1 Reply Last reply
          0
          • S Star09

            I have removed the path because it was so long, but I do have it in my application, lol. As for the double spaces, didn't notice them, thanks, but still even though I removed the double spaces, still same runtime error

            M Offline
            M Offline
            musefan
            wrote on last edited by
            #5

            Star09 wrote:

            As for the double spaces, didn't notice them, thanks, but still even though I removed the double spaces, still same runtime error

            you should reply that message to me.... What is the error message you are getting?

            Life goes very fast. Tomorrow, today is already yesterday.

            S 1 Reply Last reply
            0
            • M musefan

              Star09 wrote:

              As for the double spaces, didn't notice them, thanks, but still even though I removed the double spaces, still same runtime error

              you should reply that message to me.... What is the error message you are getting?

              Life goes very fast. Tomorrow, today is already yesterday.

              S Offline
              S Offline
              Star09
              wrote on last edited by
              #6

              the message doesn't make sense, Syntax error in FROM clause.

              S 1 Reply Last reply
              0
              • S Star09

                the message doesn't make sense, Syntax error in FROM clause.

                S Offline
                S Offline
                Star09
                wrote on last edited by
                #7

                Okay when I commented my other connections, it worked.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups