M
Maurice Mertens
Hi,
i'm having a problem with generating an updatcommand.
My form consists of 2 datasets, dsFS1 and dsFS100. The fields of dsFS1
are on tabpage1, the fields of dsFS100 are on tabpage2. dsFS1 contains 1
table: tblClient, dsFS100 also contains 1 table: tblTarieven. I declared
a oledbdataadapter global, daAdapter.
When a user opens the form, tabpage1 is displayed and after setting the
SELECT command for tblClient (SELECT * FROM tblClient) dsFS1 is filled
and the commandbuilder is used to generate the updatecommand for
tblClienten. So far everything goes well.
When tabpage2 is selected, the SELECT command of daAdapter is changed to
tblTarieven (SELECT * FROM tblTarieven) is set and dsFS100 is filled. I
used the commandbuilder to generate the UPDATE command for dsFS100. But
when I call daadapter.update(dsFS100, "tblTarieven") no changes are made
to the database. The row in the dataset has rowstate 'modified'. I
checked the updatecommand and was very supprised to see that it was the
updatecommand for tblClient (dsFS1).
I also tried RefreshSchema but this didn;t work. I can't change the
updatecommand by using the oledbcommandbuilder. Am I missing something?
strQry = "SELECT * " & _
"FROM tblTarieven " & _
"WHERE [TV-DebNr] = " & lngDebNr & ";"
daAdapter.SelectCommand.CommandText = strQry
cmb = New OleDb.OleDbCommandBuilder(daAdapter)
cmb.QuotePrefix = "["
cmb.QuoteSuffix = "]"
daAdapter.Fill(dsFS100, "tblTarieven")
the updatecommand doesn't change to tblTarieven but is still the
updatecommand for tblClient.
--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering
Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl
tel: +31 162 470 534
fax: +31 162 470 502
i'm having a problem with generating an updatcommand.
My form consists of 2 datasets, dsFS1 and dsFS100. The fields of dsFS1
are on tabpage1, the fields of dsFS100 are on tabpage2. dsFS1 contains 1
table: tblClient, dsFS100 also contains 1 table: tblTarieven. I declared
a oledbdataadapter global, daAdapter.
When a user opens the form, tabpage1 is displayed and after setting the
SELECT command for tblClient (SELECT * FROM tblClient) dsFS1 is filled
and the commandbuilder is used to generate the updatecommand for
tblClienten. So far everything goes well.
When tabpage2 is selected, the SELECT command of daAdapter is changed to
tblTarieven (SELECT * FROM tblTarieven) is set and dsFS100 is filled. I
used the commandbuilder to generate the UPDATE command for dsFS100. But
when I call daadapter.update(dsFS100, "tblTarieven") no changes are made
to the database. The row in the dataset has rowstate 'modified'. I
checked the updatecommand and was very supprised to see that it was the
updatecommand for tblClient (dsFS1).
I also tried RefreshSchema but this didn;t work. I can't change the
updatecommand by using the oledbcommandbuilder. Am I missing something?
strQry = "SELECT * " & _
"FROM tblTarieven " & _
"WHERE [TV-DebNr] = " & lngDebNr & ";"
daAdapter.SelectCommand.CommandText = strQry
cmb = New OleDb.OleDbCommandBuilder(daAdapter)
cmb.QuotePrefix = "["
cmb.QuoteSuffix = "]"
daAdapter.Fill(dsFS100, "tblTarieven")
the updatecommand doesn't change to tblTarieven but is still the
updatecommand for tblClient.
--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering
Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl
tel: +31 162 470 534
fax: +31 162 470 502