Help with Data Please

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?RW1tYSBIb3Bl?=

    #1

    Help with Data Please

    Hi All,

    I have VB & SQL 2005 Express but i'm afraid i am a newbie, my background is
    in MS Access so please if you can give me any advice, please take my
    inexperience into consideration.

    I have two tables, i won't detail all the fields but just those that are
    relevant.

    Table 1
    Company Name
    Profits
    Tax Year

    Table 2
    Tax Year
    Tax Rate

    quite simply i need to join the tables on the Tax Year fields so that when i
    make another calculated field i.e. TaxPaid (= TaxRate*Profits ) it picks up
    the right TaxRate for the right TaxYear.

    If i do this using a join, my table (& therefore my user form) is always
    read-only, so i can't change the Profits or anything (which needs to be done!)

    In MS Access i would change the Recordset Type to Dynaset (Inconsistent
    Update) is there something similar i need to do in VB to get this to work or
    can anyone suggest any other way around it.

    Please remember i am very much a newbie, i have tried the help files but
    don't know what i am looking for, i have read several books but i can't
    figure this one out.

    Thanks very much
    Emma

  • Mr. Arnold

    #2
    Re: Help with Data Please


    "Emma Hope" <EmmaHope@discu ssions.microsof t.comwrote in message
    news:E4BB3AD7-BEFF-441A-840A-2F4B8AE2F139@mi crosoft.com...
    Hi All,
    >
    I have VB & SQL 2005 Express but i'm afraid i am a newbie, my background
    is
    in MS Access so please if you can give me any advice, please take my
    inexperience into consideration.
    >
    I have two tables, i won't detail all the fields but just those that are
    relevant.
    >
    Table 1
    Company Name
    Profits
    Tax Year
    >
    Table 2
    Tax Year
    Tax Rate
    >
    quite simply i need to join the tables on the Tax Year fields so that when
    i
    make another calculated field i.e. TaxPaid (= TaxRate*Profits ) it picks up
    the right TaxRate for the right TaxYear.
    >
    If i do this using a join, my table (& therefore my user form) is always
    read-only, so i can't change the Profits or anything (which needs to be
    done!)
    >
    In MS Access i would change the Recordset Type to Dynaset (Inconsistent
    Update) is there something similar i need to do in VB to get this to work
    or
    can anyone suggest any other way around it.
    >
    Please remember i am very much a newbie, i have tried the help files but
    don't know what i am looking for, i have read several books but i can't
    figure this one out.
    Google is your friend.

    I hope the link with some insight and examples will get you into the
    ballpark.



    You should think ADO.NET dataadapter, dataset and recordset.

    You should get yourself a good ADO.Net book.

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: Help with Data Please

      Emma,

      It is never readonly, you cannot set that, however remember you need forever
      the primary key to do an update, a delete or a insert.

      VB.Net has very few methods to make the update part and will certainly not
      do that in these versions with joined tables, you have to make the SQL
      transaction code yourself for that. Are you great in that part of
      programming it will no problem for you, otherwise forget it a while and just
      read two tables.



      Cor

      "Emma Hope" <EmmaHope@discu ssions.microsof t.comschreef in bericht
      news:E4BB3AD7-BEFF-441A-840A-2F4B8AE2F139@mi crosoft.com...
      Hi All,
      >
      I have VB & SQL 2005 Express but i'm afraid i am a newbie, my background
      is
      in MS Access so please if you can give me any advice, please take my
      inexperience into consideration.
      >
      I have two tables, i won't detail all the fields but just those that are
      relevant.
      >
      Table 1
      Company Name
      Profits
      Tax Year
      >
      Table 2
      Tax Year
      Tax Rate
      >
      quite simply i need to join the tables on the Tax Year fields so that when
      i
      make another calculated field i.e. TaxPaid (= TaxRate*Profits ) it picks up
      the right TaxRate for the right TaxYear.
      >
      If i do this using a join, my table (& therefore my user form) is always
      read-only, so i can't change the Profits or anything (which needs to be
      done!)
      >
      In MS Access i would change the Recordset Type to Dynaset (Inconsistent
      Update) is there something similar i need to do in VB to get this to work
      or
      can anyone suggest any other way around it.
      >
      Please remember i am very much a newbie, i have tried the help files but
      don't know what i am looking for, i have read several books but i can't
      figure this one out.
      >
      Thanks very much
      Emma
      >

      Comment

      Working...