Help with Data Please

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Emma Hope said:
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.

http://www.google.com/search?hl=en&...and+fill+a+dataset+ado.net&btnG=Google+Search

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

You should get yourself a good ADO.Net book.
 
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.

http://www.vb-tips.com/dbpages.aspx?ID=5fd5a8cf-54dc-4946-a193-8a9529b2b38b

Cor
 
Back
Top