Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

access and VB.net

Discussion in 'Information Technology' started by asdf, Jul 28, 2006.

Tags:
  1. asdf

    asdf
    Expand Collapse
    Guest

    Hello, I've been having problems updating my database through visual basic.
    I was thinking there was something wrong with my code, but someone said that
    there might also be some kind of constraint on my database? Are there
    different constraints that could be put on databases so that they couldn't be
    altered through another program? How do I see or learn about database
    constraints?
     
  2. Loading...


  3. david epsom dot com dot au

    david epsom dot com dot au
    Expand Collapse
    Guest

    There are no constraint in MS Access to prevent a database
    being updated by 'another program'. This is a major
    limitation of Access security.

    There are of course operating system constraints that prevent
    updating: for example, if the database is read-only, or if
    you only have read-only file permission etc.

    There is also password and user-level security that
    can be applied to an Access database. User level security
    is difficult to explain, and you don't want to worry
    about it unless you think it is actually in use.

    Can you update the database at all, by any method, using
    any program?

    (david)

    "asdf" <asdf@discussions.microsoft.com> wrote in message
    news:AFC1578E-BFB1-4D6E-97C7-7F09A578291B@microsoft.com...
    > Hello, I've been having problems updating my database through visual
    > basic.
    > I was thinking there was something wrong with my code, but someone said
    > that
    > there might also be some kind of constraint on my database? Are there
    > different constraints that could be put on databases so that they couldn't
    > be
    > altered through another program? How do I see or learn about database
    > constraints?
     
  4. asdf

    asdf
    Expand Collapse
    Guest

    Hello and Thank you David epsom dot com

    I can change the database if I go in the database and change it. When I run
    my visual basic program, I get an error message when I use
    DataAdpater.Update. I can make temperary changes, but those changes are
    actually not changes to the database, but to the dataset that VB got. When I
    restart the program, the data appears the same as before I made changes.
     
  5. david epsom dot com dot au

    david epsom dot com dot au
    Expand Collapse
    Guest

    When you 'go into the database', do you use a special shortcut,
    or provide a login name, or password? if not, you don't have
    any Access security, and there is nothing we can do to help
    you.

    What is the error you get when you try to update? Have you
    opened the connection in a read-only mode? Are you trying
    to update a non-updateable recordset?

    Apart from that, you need to ask in a .Net group

    (david)


    "asdf" <asdf@discussions.microsoft.com> wrote in message
    news:3C00CDE6-5EDC-4C97-9F3F-F29D44C7B69F@microsoft.com...
    > Hello and Thank you David epsom dot com
    >
    > I can change the database if I go in the database and change it. When I
    > run
    > my visual basic program, I get an error message when I use
    > DataAdpater.Update. I can make temperary changes, but those changes are
    > actually not changes to the database, but to the dataset that VB got.
    > When I
    > restart the program, the data appears the same as before I made changes.
    >
    >
     
  6. asdf

    asdf
    Expand Collapse
    Guest

    hello david

    My database doesn't have any password or anything. I guess one problem is
    that I am American and working in Japan and I cannot read the error messages
    but I will translate it the best that I can

    error message:

    'System.Data.OleDb.OleDbException' no handoru(handle) saretenai(not or
    isn't) reigai(exception or something abnormal) ga system.data.dll de
    hassei(occurrence or incidence) shimashita(happened)

    Does it sound familiar? It's probably a VB problem. Thank you for your
    time though.



    "david epsom dot com dot au" wrote:

    > When you 'go into the database', do you use a special shortcut,
    > or provide a login name, or password? if not, you don't have
    > any Access security, and there is nothing we can do to help
    > you.
    >
    > What is the error you get when you try to update? Have you
    > opened the connection in a read-only mode? Are you trying
    > to update a non-updateable recordset?
    >
    > Apart from that, you need to ask in a .Net group
    >
    > (david)
    >
    >
    > "asdf" <asdf@discussions.microsoft.com> wrote in message
    > news:3C00CDE6-5EDC-4C97-9F3F-F29D44C7B69F@microsoft.com...
    > > Hello and Thank you David epsom dot com
    > >
    > > I can change the database if I go in the database and change it. When I
    > > run
    > > my visual basic program, I get an error message when I use
    > > DataAdpater.Update. I can make temperary changes, but those changes are
    > > actually not changes to the database, but to the dataset that VB got.
    > > When I
    > > restart the program, the data appears the same as before I made changes.
    > >
    > >

    >
    >
    >
     
  7. david epsom dot com dot au

    david epsom dot com dot au
    Expand Collapse
    Guest

    I don't read Japanese either: you should see if you can
    capture an error number as well as the text :~) Guessing
    that perhaps you disconnected from the database after
    reading the data?

    It is doubtless a problem with your database objects
    rather than with VB or with your database as such. If
    you can find some one who is familiar with ADO.NET,
    it probably has a trivial solution.

    Good luck,

    (david)

    "asdf" <asdf@discussions.microsoft.com> wrote in message
    news:F0855B73-712D-4FBD-AB0F-19E3CBBBE78E@microsoft.com...
    > hello david
    >
    > My database doesn't have any password or anything. I guess one problem is
    > that I am American and working in Japan and I cannot read the error
    > messages
    > but I will translate it the best that I can
    >
    > error message:
    >
    > 'System.Data.OleDb.OleDbException' no handoru(handle) saretenai(not or
    > isn't) reigai(exception or something abnormal) ga system.data.dll de
    > hassei(occurrence or incidence) shimashita(happened)
    >
    > Does it sound familiar? It's probably a VB problem. Thank you for your
    > time though.
    >
    >
    >
    > "david epsom dot com dot au" wrote:
    >
    >> When you 'go into the database', do you use a special shortcut,
    >> or provide a login name, or password? if not, you don't have
    >> any Access security, and there is nothing we can do to help
    >> you.
    >>
    >> What is the error you get when you try to update? Have you
    >> opened the connection in a read-only mode? Are you trying
    >> to update a non-updateable recordset?
    >>
    >> Apart from that, you need to ask in a .Net group
    >>
    >> (david)
    >>
    >>
    >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    >> news:3C00CDE6-5EDC-4C97-9F3F-F29D44C7B69F@microsoft.com...
    >> > Hello and Thank you David epsom dot com
    >> >
    >> > I can change the database if I go in the database and change it. When
    >> > I
    >> > run
    >> > my visual basic program, I get an error message when I use
    >> > DataAdpater.Update. I can make temperary changes, but those changes
    >> > are
    >> > actually not changes to the database, but to the dataset that VB got.
    >> > When I
    >> > restart the program, the data appears the same as before I made
    >> > changes.
    >> >
    >> >

    >>
    >>
    >>
     
  8. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    Is the word 'handoru' used to mean anything other than 'handle'? Might it,
    perhaps, be used to mean 'connection'?

    --
    Brendan Reynolds
    Access MVP

    "asdf" <asdf@discussions.microsoft.com> wrote in message
    news:F0855B73-712D-4FBD-AB0F-19E3CBBBE78E@microsoft.com...
    > hello david
    >
    > My database doesn't have any password or anything. I guess one problem is
    > that I am American and working in Japan and I cannot read the error
    > messages
    > but I will translate it the best that I can
    >
    > error message:
    >
    > 'System.Data.OleDb.OleDbException' no handoru(handle) saretenai(not or
    > isn't) reigai(exception or something abnormal) ga system.data.dll de
    > hassei(occurrence or incidence) shimashita(happened)
    >
    > Does it sound familiar? It's probably a VB problem. Thank you for your
    > time though.
    >
    >
    >
    > "david epsom dot com dot au" wrote:
    >
    >> When you 'go into the database', do you use a special shortcut,
    >> or provide a login name, or password? if not, you don't have
    >> any Access security, and there is nothing we can do to help
    >> you.
    >>
    >> What is the error you get when you try to update? Have you
    >> opened the connection in a read-only mode? Are you trying
    >> to update a non-updateable recordset?
    >>
    >> Apart from that, you need to ask in a .Net group
    >>
    >> (david)
    >>
    >>
    >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    >> news:3C00CDE6-5EDC-4C97-9F3F-F29D44C7B69F@microsoft.com...
    >> > Hello and Thank you David epsom dot com
    >> >
    >> > I can change the database if I go in the database and change it. When
    >> > I
    >> > run
    >> > my visual basic program, I get an error message when I use
    >> > DataAdpater.Update. I can make temperary changes, but those changes
    >> > are
    >> > actually not changes to the database, but to the dataset that VB got.
    >> > When I
    >> > restart the program, the data appears the same as before I made
    >> > changes.
    >> >
    >> >

    >>
    >>
    >>
     
  9. asdf

    asdf
    Expand Collapse
    Guest

    I don't think it does, but I don't know everything about computers and/or
    Japanese. Does the message sound familiar? I'm gonna keep reading more
    about vb and ado maybe I can make it work if I understood it better.

    "Brendan Reynolds" wrote:

    > Is the word 'handoru' used to mean anything other than 'handle'? Might it,
    > perhaps, be used to mean 'connection'?
    >
    > --
    > Brendan Reynolds
    > Access MVP
    >
    > "asdf" <asdf@discussions.microsoft.com> wrote in message
    > news:F0855B73-712D-4FBD-AB0F-19E3CBBBE78E@microsoft.com...
    > > hello david
    > >
    > > My database doesn't have any password or anything. I guess one problem is
    > > that I am American and working in Japan and I cannot read the error
    > > messages
    > > but I will translate it the best that I can
    > >
    > > error message:
    > >
    > > 'System.Data.OleDb.OleDbException' no handoru(handle) saretenai(not or
    > > isn't) reigai(exception or something abnormal) ga system.data.dll de
    > > hassei(occurrence or incidence) shimashita(happened)
    > >
    > > Does it sound familiar? It's probably a VB problem. Thank you for your
    > > time though.
    > >
    > >
    > >
    > > "david epsom dot com dot au" wrote:
    > >
    > >> When you 'go into the database', do you use a special shortcut,
    > >> or provide a login name, or password? if not, you don't have
    > >> any Access security, and there is nothing we can do to help
    > >> you.
    > >>
    > >> What is the error you get when you try to update? Have you
    > >> opened the connection in a read-only mode? Are you trying
    > >> to update a non-updateable recordset?
    > >>
    > >> Apart from that, you need to ask in a .Net group
    > >>
    > >> (david)
    > >>
    > >>
    > >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    > >> news:3C00CDE6-5EDC-4C97-9F3F-F29D44C7B69F@microsoft.com...
    > >> > Hello and Thank you David epsom dot com
    > >> >
    > >> > I can change the database if I go in the database and change it. When
    > >> > I
    > >> > run
    > >> > my visual basic program, I get an error message when I use
    > >> > DataAdpater.Update. I can make temperary changes, but those changes
    > >> > are
    > >> > actually not changes to the database, but to the dataset that VB got.
    > >> > When I
    > >> > restart the program, the data appears the same as before I made
    > >> > changes.
    > >> >
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >
     
  10. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    'Handle' didn't seem to make much sense in the context, 'connection' was the
    closest thing I could think of that might make sense in that context. But
    without seeing the code, the connection string, and the SQL, I can only
    guess.

    The most likely places to look for an error of this kind are probably the
    connection string, the code that opens the connection, the code that assigns
    values to parameters, if any, or the SQL of the update command. In a
    multi-user app another possibility to look into would be concurrency errors,
    e.g. the data has changed between the time you retrieved it from the
    database and the time you attempt to update it. If the table you are
    updating has an AutoNumber field, also make sure that you are not attempting
    to update that field.

    As you can see, there are a number of possibilities. I'm afraid the above is
    not an exhaustive list, there are probably quite a few more. If possible, it
    might help if you could find a native Japanese speaker to translate the
    error messages.

    --
    Brendan Reynolds
    Access MVP

    "asdf" <asdf@discussions.microsoft.com> wrote in message
    news:96DE7292-4DF8-48F0-ACA1-59633638ED98@microsoft.com...
    >I don't think it does, but I don't know everything about computers and/or
    > Japanese. Does the message sound familiar? I'm gonna keep reading more
    > about vb and ado maybe I can make it work if I understood it better.
    >
    > "Brendan Reynolds" wrote:
    >
    >> Is the word 'handoru' used to mean anything other than 'handle'? Might
    >> it,
    >> perhaps, be used to mean 'connection'?
    >>
    >> --
    >> Brendan Reynolds
    >> Access MVP
    >>
    >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    >> news:F0855B73-712D-4FBD-AB0F-19E3CBBBE78E@microsoft.com...
    >> > hello david
    >> >
    >> > My database doesn't have any password or anything. I guess one problem
    >> > is
    >> > that I am American and working in Japan and I cannot read the error
    >> > messages
    >> > but I will translate it the best that I can
    >> >
    >> > error message:
    >> >
    >> > 'System.Data.OleDb.OleDbException' no handoru(handle) saretenai(not or
    >> > isn't) reigai(exception or something abnormal) ga system.data.dll de
    >> > hassei(occurrence or incidence) shimashita(happened)
    >> >
    >> > Does it sound familiar? It's probably a VB problem. Thank you for
    >> > your
    >> > time though.
    >> >
    >> >
    >> >
    >> > "david epsom dot com dot au" wrote:
    >> >
    >> >> When you 'go into the database', do you use a special shortcut,
    >> >> or provide a login name, or password? if not, you don't have
    >> >> any Access security, and there is nothing we can do to help
    >> >> you.
    >> >>
    >> >> What is the error you get when you try to update? Have you
    >> >> opened the connection in a read-only mode? Are you trying
    >> >> to update a non-updateable recordset?
    >> >>
    >> >> Apart from that, you need to ask in a .Net group
    >> >>
    >> >> (david)
    >> >>
    >> >>
    >> >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    >> >> news:3C00CDE6-5EDC-4C97-9F3F-F29D44C7B69F@microsoft.com...
    >> >> > Hello and Thank you David epsom dot com
    >> >> >
    >> >> > I can change the database if I go in the database and change it.
    >> >> > When
    >> >> > I
    >> >> > run
    >> >> > my visual basic program, I get an error message when I use
    >> >> > DataAdpater.Update. I can make temperary changes, but those changes
    >> >> > are
    >> >> > actually not changes to the database, but to the dataset that VB
    >> >> > got.
    >> >> > When I
    >> >> > restart the program, the data appears the same as before I made
    >> >> > changes.
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>
     
  11. asdf

    asdf
    Expand Collapse
    Guest

    I don't know much about programming so I have been using code that I don't
    completely understand like the CB...I just used what the tutorial says:

    "To update the database, you need some extra code. Amend your code to this
    (the new lines are in bold, red text):


    Dim cb As New OleDb.OleDbCommandBuilder(da)

    ds.Tables("AddressBook").Rows(inc).Item(1) = txtFirstName.Text
    ds.Tables("AddressBook").Rows(inc).Item(2) = txtSurname.Text

    da.Update(ds, "AddressBook")

    MsgBox("Data updated")"

    (http://www.homeandlearn.co.uk/NET/nets12p9.html)


    here is most of my code...

    Public Class Form1
    Inherits System.Windows.Forms.Form

    Dim increment As Integer
    Dim maxrows As Integer

    Dim con As New OleDb.OleDbConnection()
    Dim dset As New DataSet()
    Dim dadapt As OleDb.OleDbDataAdapter
    Dim sql As String

    Private Sub navigateRecords() 'this is a sub that figures out which
    record
    txtCD.Text = dset.Tables("bihin").Rows(increment).Item(1)
    txtå.Text = dset.Tables("bihin").Rows(increment).Item(2)
    cmbbxå‚™å“区分.Text = dset.Tables("bihin").Rows(increment).Item(3)
    cmbbxメディア.Text = dset.Tables("bihin").Rows(increment).Item(4)
    txtPN.Text = dset.Tables("bihin").Rows(increment).Item(5)
    txtSN.Text = dset.Tables("bihin").Rows(increment).Item(6)
    cmbbx購入先.Text = dset.Tables("bihin").Rows(increment).Item(7)
    txtä½æ‰€.Text = dset.Tables("bihin").Rows(increment).Item(8)
    txtTEL.Text = dset.Tables("bihin").Rows(increment).Item(9)
    txtæ—¥.Text = dset.Tables("bihin").Rows(increment).Item(10)
    txtä¿éšœæœŸé–“.Text = dset.Tables("bihin").Rows(increment).Item(11)
    txtä¿éšœå†…容.Text = dset.Tables("bihin").Rows(increment).Item(12)
    cmbbxä¿ç®¡å ´æ‰€.Text = dset.Tables("bihin").Rows(increment).Item(13)
    cmbbxä¿ç®¡è²¬ä»»è€….Text = dset.Tables("bihin").Rows(increment).Item(14)
    txtå‚™å“内容.Text = dset.Tables("bihin").Rows(increment).Item(15)

    End Sub


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load 'loading the form

    con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
    Source=C:\Documents and Settings\Administrator\My Documents\eileen\eileen's
    databases\bihin.mdb"
    con.Open()

    sql = "SELECT*FROM bihinTable"
    dadapt = New OleDb.OleDbDataAdapter(sql, con)
    dadapt.Fill(dset, "bihin")

    con.Close()

    maxrows = dset.Tables("bihin").Rows.Count 'counting the number of rows

    End Sub

    Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btnNext.Click 'moving to the next
    record
    If increment <> maxrows - 1 Then
    increment = increment + 1
    navigateRecords()
    Else
    MsgBox("No more rows")
    End If
    End Sub

    Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btnPrevious.Click 'moving to previous
    record
    If increment > 0 Then
    increment = increment - 1
    navigateRecords()
    Else
    MsgBox("First record")
    End If
    End Sub

    Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btnFirst.Click 'first record
    If increment <> 0 Then
    increment = 0
    navigateRecords()
    End If
    End Sub

    Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btnLast.Click 'last record
    If increment <> maxrows - 1 Then
    increment = maxrows - 1
    navigateRecords()
    End If
    End Sub

    Private Sub btn登録_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btn登録.Click 'place that the update
    doesn't work
    Dim cb As New OleDb.OleDbCommandBuilder(dadapt)

    dset.Tables("bihin").Rows(increment).Item(1) = txtCD.Text
    dset.Tables("bihin").Rows(increment).Item(2) = txtå.Text
    dset.Tables("bihin").Rows(increment).Item(3) = cmbbxå‚™å“区分.Text
    dset.Tables("bihin").Rows(increment).Item(4) = cmbbxメディア.Text
    dset.Tables("bihin").Rows(increment).Item(5) = txtPN.Text
    dset.Tables("bihin").Rows(increment).Item(6) = txtSN.Text
    dset.Tables("bihin").Rows(increment).Item(7) = cmbbx購入先.Text
    dset.Tables("bihin").Rows(increment).Item(8) = txtä½æ‰€.Text
    dset.Tables("bihin").Rows(increment).Item(9) = txtTEL.Text
    dset.Tables("bihin").Rows(increment).Item(10) = txtæ—¥.Text
    dset.Tables("bihin").Rows(increment).Item(11) = txtä¿éšœæœŸé–“.Text
    dset.Tables("bihin").Rows(increment).Item(12) = txtä¿éšœå†…容.Text
    dset.Tables("bihin").Rows(increment).Item(13) = cmbbxä¿ç®¡å ´æ‰€.Text
    dset.Tables("bihin").Rows(increment).Item(14) = cmbbxä¿ç®¡è²¬ä»»è€….Text
    dset.Tables("bihin").Rows(increment).Item(14) = txtå‚™å“内容.Text

    dadapt.Update(dset, "bihin")
    MsgBox("updated")

    End Sub

    Private Sub btnæ–°è¦ä½œæˆ_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btnæ–°è¦ä½œæˆ.Click 'clearing a record
    txtCD.Clear()
    txtå.Clear()
    txtPN.Clear()
    txtSN.Clear()
    txtä½æ‰€.Clear()
    txtTEL.Clear()
    txtæ—¥.Clear()
    txtä¿éšœæœŸé–“.Clear()
    txtä¿éšœå†…容.Clear()
    txtå‚™å“内容.Clear()
    End Sub



    "Brendan Reynolds" wrote:

    >
    > 'Handle' didn't seem to make much sense in the context, 'connection' was the
    > closest thing I could think of that might make sense in that context. But
    > without seeing the code, the connection string, and the SQL, I can only
    > guess.
    >
    > The most likely places to look for an error of this kind are probably the
    > connection string, the code that opens the connection, the code that assigns
    > values to parameters, if any, or the SQL of the update command. In a
    > multi-user app another possibility to look into would be concurrency errors,
    > e.g. the data has changed between the time you retrieved it from the
    > database and the time you attempt to update it. If the table you are
    > updating has an AutoNumber field, also make sure that you are not attempting
    > to update that field.
    >
    > As you can see, there are a number of possibilities. I'm afraid the above is
    > not an exhaustive list, there are probably quite a few more. If possible, it
    > might help if you could find a native Japanese speaker to translate the
    > error messages.
    >
    > --
    > Brendan Reynolds
    > Access MVP
    >
    > "asdf" <asdf@discussions.microsoft.com> wrote in message
    > news:96DE7292-4DF8-48F0-ACA1-59633638ED98@microsoft.com...
    > >I don't think it does, but I don't know everything about computers and/or
    > > Japanese. Does the message sound familiar? I'm gonna keep reading more
    > > about vb and ado maybe I can make it work if I understood it better.
    > >
    > > "Brendan Reynolds" wrote:
    > >
    > >> Is the word 'handoru' used to mean anything other than 'handle'? Might
    > >> it,
    > >> perhaps, be used to mean 'connection'?
    > >>
    > >> --
    > >> Brendan Reynolds
    > >> Access MVP
    > >>
    > >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    > >> news:F0855B73-712D-4FBD-AB0F-19E3CBBBE78E@microsoft.com...
    > >> > hello david
    > >> >
    > >> > My database doesn't have any password or anything. I guess one problem
    > >> > is
    > >> > that I am American and working in Japan and I cannot read the error
    > >> > messages
    > >> > but I will translate it the best that I can
    > >> >
    > >> > error message:
    > >> >
    > >> > 'System.Data.OleDb.OleDbException' no handoru(handle) saretenai(not or
    > >> > isn't) reigai(exception or something abnormal) ga system.data.dll de
    > >> > hassei(occurrence or incidence) shimashita(happened)
    > >> >
    > >> > Does it sound familiar? It's probably a VB problem. Thank you for
    > >> > your
    > >> > time though.
    > >> >
    > >> >
    > >> >
    > >> > "david epsom dot com dot au" wrote:
    > >> >
    > >> >> When you 'go into the database', do you use a special shortcut,
    > >> >> or provide a login name, or password? if not, you don't have
    > >> >> any Access security, and there is nothing we can do to help
    > >> >> you.
    > >> >>
    > >> >> What is the error you get when you try to update? Have you
    > >> >> opened the connection in a read-only mode? Are you trying
    > >> >> to update a non-updateable recordset?
    > >> >>
    > >> >> Apart from that, you need to ask in a .Net group
    > >> >>
    > >> >> (david)
    > >> >>
    > >> >>
    > >> >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    > >> >> news:3C00CDE6-5EDC-4C97-9F3F-F29D44C7B69F@microsoft.com...
    > >> >> > Hello and Thank you David epsom dot com
    > >> >> >
    > >> >> > I can change the database if I go in the database and change it.
    > >> >> > When
    > >> >> > I
    > >> >> > run
    > >> >> > my visual basic program, I get an error message when I use
    > >> >> > DataAdpater.Update. I can make temperary changes, but those changes
    > >> >> > are
    > >> >> > actually not changes to the database, but to the dataset that VB
    > >> >> > got.
    > >> >> > When I
    > >> >> > restart the program, the data appears the same as before I made
    > >> >> > changes.
    > >> >> >
    > >> >> >
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >
     
  12. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    Try adding the indicated lines to your problem sub. I've marked the new
    lines with comments. (I read newsgroup posts in plain text, so I don't see
    any bold or coloured formatting).

    con.Open() ' <= new code
    dadapt.Update(dset, "bihin")
    con.Close() ' <= new code
    MsgBox("updated")

    --
    Brendan Reynolds
    Access MVP

    "asdf" <asdf@discussions.microsoft.com> wrote in message
    news:26873FE0-0CF6-4A36-BB7C-90FD66FF1D51@microsoft.com...
    >I don't know much about programming so I have been using code that I don't
    > completely understand like the CB...I just used what the tutorial says:
    >
    > "To update the database, you need some extra code. Amend your code to this
    > (the new lines are in bold, red text):
    >
    >
    > Dim cb As New OleDb.OleDbCommandBuilder(da)
    >
    > ds.Tables("AddressBook").Rows(inc).Item(1) = txtFirstName.Text
    > ds.Tables("AddressBook").Rows(inc).Item(2) = txtSurname.Text
    >
    > da.Update(ds, "AddressBook")
    >
    > MsgBox("Data updated")"
    >
    > (http://www.homeandlearn.co.uk/NET/nets12p9.html)
    >
    >
    > here is most of my code...
    >
    > Public Class Form1
    > Inherits System.Windows.Forms.Form
    >
    > Dim increment As Integer
    > Dim maxrows As Integer
    >
    > Dim con As New OleDb.OleDbConnection()
    > Dim dset As New DataSet()
    > Dim dadapt As OleDb.OleDbDataAdapter
    > Dim sql As String
    >
    > Private Sub navigateRecords() 'this is a sub that figures out which
    > record
    > txtCD.Text = dset.Tables("bihin").Rows(increment).Item(1)
    > txt?.Text = dset.Tables("bihin").Rows(increment).Item(2)
    > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(3)
    > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(4)
    > txtPN.Text = dset.Tables("bihin").Rows(increment).Item(5)
    > txtSN.Text = dset.Tables("bihin").Rows(increment).Item(6)
    > cmbbx???.Text = dset.Tables("bihin").Rows(increment).Item(7)
    > txt??.Text = dset.Tables("bihin").Rows(increment).Item(8)
    > txtTEL.Text = dset.Tables("bihin").Rows(increment).Item(9)
    > txt?.Text = dset.Tables("bihin").Rows(increment).Item(10)
    > txt????.Text = dset.Tables("bihin").Rows(increment).Item(11)
    > txt????.Text = dset.Tables("bihin").Rows(increment).Item(12)
    > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(13)
    > cmbbx?????.Text = dset.Tables("bihin").Rows(increment).Item(14)
    > txt????.Text = dset.Tables("bihin").Rows(increment).Item(15)
    >
    > End Sub
    >
    >
    > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load 'loading the form
    >
    > con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
    > Source=C:\Documents and Settings\Administrator\My
    > Documents\eileen\eileen's
    > databases\bihin.mdb"
    > con.Open()
    >
    > sql = "SELECT*FROM bihinTable"
    > dadapt = New OleDb.OleDbDataAdapter(sql, con)
    > dadapt.Fill(dset, "bihin")
    >
    > con.Close()
    >
    > maxrows = dset.Tables("bihin").Rows.Count 'counting the number of
    > rows
    >
    > End Sub
    >
    > Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles btnNext.Click 'moving to the next
    > record
    > If increment <> maxrows - 1 Then
    > increment = increment + 1
    > navigateRecords()
    > Else
    > MsgBox("No more rows")
    > End If
    > End Sub
    >
    > Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles btnPrevious.Click 'moving to previous
    > record
    > If increment > 0 Then
    > increment = increment - 1
    > navigateRecords()
    > Else
    > MsgBox("First record")
    > End If
    > End Sub
    >
    > Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles btnFirst.Click 'first record
    > If increment <> 0 Then
    > increment = 0
    > navigateRecords()
    > End If
    > End Sub
    >
    > Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles btnLast.Click 'last record
    > If increment <> maxrows - 1 Then
    > increment = maxrows - 1
    > navigateRecords()
    > End If
    > End Sub
    >
    > Private Sub btn??_Click(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles btn??.Click 'place that the update
    > doesn't work
    > Dim cb As New OleDb.OleDbCommandBuilder(dadapt)
    >
    > dset.Tables("bihin").Rows(increment).Item(1) = txtCD.Text
    > dset.Tables("bihin").Rows(increment).Item(2) = txt?.Text
    > dset.Tables("bihin").Rows(increment).Item(3) = cmbbx????.Text
    > dset.Tables("bihin").Rows(increment).Item(4) = cmbbx????.Text
    > dset.Tables("bihin").Rows(increment).Item(5) = txtPN.Text
    > dset.Tables("bihin").Rows(increment).Item(6) = txtSN.Text
    > dset.Tables("bihin").Rows(increment).Item(7) = cmbbx???.Text
    > dset.Tables("bihin").Rows(increment).Item(8) = txt??.Text
    > dset.Tables("bihin").Rows(increment).Item(9) = txtTEL.Text
    > dset.Tables("bihin").Rows(increment).Item(10) = txt?.Text
    > dset.Tables("bihin").Rows(increment).Item(11) = txt????.Text
    > dset.Tables("bihin").Rows(increment).Item(12) = txt????.Text
    > dset.Tables("bihin").Rows(increment).Item(13) = cmbbx????.Text
    > dset.Tables("bihin").Rows(increment).Item(14) = cmbbx?????.Text
    > dset.Tables("bihin").Rows(increment).Item(14) = txt????.Text
    >
    > dadapt.Update(dset, "bihin")
    > MsgBox("updated")
    >
    > End Sub
    >
    > Private Sub btn????_Click(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles btn????.Click 'clearing a record
    > txtCD.Clear()
    > txt?.Clear()
    > txtPN.Clear()
    > txtSN.Clear()
    > txt??.Clear()
    > txtTEL.Clear()
    > txt?.Clear()
    > txt????.Clear()
    > txt????.Clear()
    > txt????.Clear()
    > End Sub
    >
    >
    >
    > "Brendan Reynolds" wrote:
    >
    >>
    >> 'Handle' didn't seem to make much sense in the context, 'connection' was
    >> the
    >> closest thing I could think of that might make sense in that context. But
    >> without seeing the code, the connection string, and the SQL, I can only
    >> guess.
    >>
    >> The most likely places to look for an error of this kind are probably the
    >> connection string, the code that opens the connection, the code that
    >> assigns
    >> values to parameters, if any, or the SQL of the update command. In a
    >> multi-user app another possibility to look into would be concurrency
    >> errors,
    >> e.g. the data has changed between the time you retrieved it from the
    >> database and the time you attempt to update it. If the table you are
    >> updating has an AutoNumber field, also make sure that you are not
    >> attempting
    >> to update that field.
    >>
    >> As you can see, there are a number of possibilities. I'm afraid the above
    >> is
    >> not an exhaustive list, there are probably quite a few more. If possible,
    >> it
    >> might help if you could find a native Japanese speaker to translate the
    >> error messages.
    >>
    >> --
    >> Brendan Reynolds
    >> Access MVP
    >>
    >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    >> news:96DE7292-4DF8-48F0-ACA1-59633638ED98@microsoft.com...
    >> >I don't think it does, but I don't know everything about computers
    >> >and/or
    >> > Japanese. Does the message sound familiar? I'm gonna keep reading
    >> > more
    >> > about vb and ado maybe I can make it work if I understood it better.
    >> >
    >> > "Brendan Reynolds" wrote:
    >> >
    >> >> Is the word 'handoru' used to mean anything other than 'handle'? Might
    >> >> it,
    >> >> perhaps, be used to mean 'connection'?
    >> >>
    >> >> --
    >> >> Brendan Reynolds
    >> >> Access MVP
    >> >>
    >> >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    >> >> news:F0855B73-712D-4FBD-AB0F-19E3CBBBE78E@microsoft.com...
    >> >> > hello david
    >> >> >
    >> >> > My database doesn't have any password or anything. I guess one
    >> >> > problem
    >> >> > is
    >> >> > that I am American and working in Japan and I cannot read the error
    >> >> > messages
    >> >> > but I will translate it the best that I can
    >> >> >
    >> >> > error message:
    >> >> >
    >> >> > 'System.Data.OleDb.OleDbException' no handoru(handle) saretenai(not
    >> >> > or
    >> >> > isn't) reigai(exception or something abnormal) ga system.data.dll de
    >> >> > hassei(occurrence or incidence) shimashita(happened)
    >> >> >
    >> >> > Does it sound familiar? It's probably a VB problem. Thank you for
    >> >> > your
    >> >> > time though.
    >> >> >
    >> >> >
    >> >> >
    >> >> > "david epsom dot com dot au" wrote:
    >> >> >
    >> >> >> When you 'go into the database', do you use a special shortcut,
    >> >> >> or provide a login name, or password? if not, you don't have
    >> >> >> any Access security, and there is nothing we can do to help
    >> >> >> you.
    >> >> >>
    >> >> >> What is the error you get when you try to update? Have you
    >> >> >> opened the connection in a read-only mode? Are you trying
    >> >> >> to update a non-updateable recordset?
    >> >> >>
    >> >> >> Apart from that, you need to ask in a .Net group
    >> >> >>
    >> >> >> (david)
    >> >> >>
    >> >> >>
    >> >> >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    >> >> >> news:3C00CDE6-5EDC-4C97-9F3F-F29D44C7B69F@microsoft.com...
    >> >> >> > Hello and Thank you David epsom dot com
    >> >> >> >
    >> >> >> > I can change the database if I go in the database and change it.
    >> >> >> > When
    >> >> >> > I
    >> >> >> > run
    >> >> >> > my visual basic program, I get an error message when I use
    >> >> >> > DataAdpater.Update. I can make temperary changes, but those
    >> >> >> > changes
    >> >> >> > are
    >> >> >> > actually not changes to the database, but to the dataset that VB
    >> >> >> > got.
    >> >> >> > When I
    >> >> >> > restart the program, the data appears the same as before I made
    >> >> >> > changes.
    >> >> >> >
    >> >> >> >
    >> >> >>
    >> >> >>
    >> >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>
     
  13. asdf

    asdf
    Expand Collapse
    Guest

    Hello Mr Reynolds and thank you

    I added your code but I still get error messages. I got a suggestion to put
    in a try and catch and I copied pasted the suggestion into my program and
    well.......
    I've been playing with my program so it has changed a little but here it is
    the problem section with the exception. All it does when I click the button
    is I get a message that says "an exception occurred. Please contact your
    system administrator." What is the next step?

    Private Sub btnCommit_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btnCommit.Click
    con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
    Source=C:\Documents and Settings\Administrator\My Documents\eileen\eileen's
    databases\bihin.mdb"
    If increment <> -1 Then
    Dim cb As New OleDb.OleDbCommandBuilder(dadapt)
    Dim dsetNewRow As DataRow

    dsetNewRow = dset.Tables("bihin").NewRow

    dsetNewRow.Item("å‚™å“CD") = txtCD.Text
    dsetNewRow.Item("å‚™å“å") = txtå.Text
    dsetNewRow.Item("å‚™å“区分") = cmbbxå‚™å“区分.Text
    dsetNewRow.Item("メデイア区分") = cmbbxメディア.Text
    dsetNewRow.Item("P/N") = txtPN.Text
    dsetNewRow.Item("S/N") = txtSN.Text
    dsetNewRow.Item("購入先") = cmbbx購入先.Text
    dsetNewRow.Item("購入先ä½æ‰€") = txtä½æ‰€.Text
    dsetNewRow.Item("購入Tel") = txtTEL.Text
    dsetNewRow.Item("購入日") = txt日.Text
    dsetNewRow.Item("ä¿éšœæœŸé–“") = txtä¿éšœæœŸé–“.Text
    dsetNewRow.Item("ä¿éšœå†…容") = txtä¿éšœå†…容.Text
    dsetNewRow.Item("ä¿ç®¡å ´æ‰€") = cmbbxä¿ç®¡å ´æ‰€.Text
    dsetNewRow.Item("ä¿ç®¡è²¬ä»»è€…") = cmbbxä¿ç®¡è²¬ä»»è€….Text
    dsetNewRow.Item("å‚™å“内容") = txtå‚™å“内容.Text

    dset.Tables("bihin").Rows.Add(dsetNewRow)

    con.Open()


    Try

    dadapt.Update(dset, "bihin")

    Catch ex As OleDb.OleDbException
    Dim errormessages As String
    Dim i As Integer

    For i = 0 To ex.Errors.Count - 1
    errormessages += "Index# " & i.ToString() &
    ControlChars.Cr _
    & "message: " & ex.Errors(i).Message & ControlChars.Cr _
    & "NativeError: " & ex.Errors(i).Source &
    ControlChars.Cr _
    & "source: " & ex.Errors(i).Source & ControlChars.Cr _
    & "sqlstate: " & ex.Errors(i).SQLState & ControlChars.Cr
    Next i

    Dim log As System.Diagnostics.EventLog = New
    System.Diagnostics.EventLog()
    log.Source = "my application"
    log.WriteEntry(errormessages)
    MsgBox("an exception occurred. Please contact your system
    administrator.")
    End Try


    con.Close()
    MsgBox("record added to database")

    End If


    End Sub





    "Brendan Reynolds" wrote:

    >
    > Try adding the indicated lines to your problem sub. I've marked the new
    > lines with comments. (I read newsgroup posts in plain text, so I don't see
    > any bold or coloured formatting).
    >
    > con.Open() ' <= new code
    > dadapt.Update(dset, "bihin")
    > con.Close() ' <= new code
    > MsgBox("updated")
    >
    > --
    > Brendan Reynolds
    > Access MVP
    >
    > "asdf" <asdf@discussions.microsoft.com> wrote in message
    > news:26873FE0-0CF6-4A36-BB7C-90FD66FF1D51@microsoft.com...
    > >I don't know much about programming so I have been using code that I don't
    > > completely understand like the CB...I just used what the tutorial says:
    > >
    > > "To update the database, you need some extra code. Amend your code to this
    > > (the new lines are in bold, red text):
    > >
    > >
    > > Dim cb As New OleDb.OleDbCommandBuilder(da)
    > >
    > > ds.Tables("AddressBook").Rows(inc).Item(1) = txtFirstName.Text
    > > ds.Tables("AddressBook").Rows(inc).Item(2) = txtSurname.Text
    > >
    > > da.Update(ds, "AddressBook")
    > >
    > > MsgBox("Data updated")"
    > >
    > > (http://www.homeandlearn.co.uk/NET/nets12p9.html)
    > >
    > >
    > > here is most of my code...
    > >
    > > Public Class Form1
    > > Inherits System.Windows.Forms.Form
    > >
    > > Dim increment As Integer
    > > Dim maxrows As Integer
    > >
    > > Dim con As New OleDb.OleDbConnection()
    > > Dim dset As New DataSet()
    > > Dim dadapt As OleDb.OleDbDataAdapter
    > > Dim sql As String
    > >
    > > Private Sub navigateRecords() 'this is a sub that figures out which
    > > record
    > > txtCD.Text = dset.Tables("bihin").Rows(increment).Item(1)
    > > txt?.Text = dset.Tables("bihin").Rows(increment).Item(2)
    > > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(3)
    > > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(4)
    > > txtPN.Text = dset.Tables("bihin").Rows(increment).Item(5)
    > > txtSN.Text = dset.Tables("bihin").Rows(increment).Item(6)
    > > cmbbx???.Text = dset.Tables("bihin").Rows(increment).Item(7)
    > > txt??.Text = dset.Tables("bihin").Rows(increment).Item(8)
    > > txtTEL.Text = dset.Tables("bihin").Rows(increment).Item(9)
    > > txt?.Text = dset.Tables("bihin").Rows(increment).Item(10)
    > > txt????.Text = dset.Tables("bihin").Rows(increment).Item(11)
    > > txt????.Text = dset.Tables("bihin").Rows(increment).Item(12)
    > > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(13)
    > > cmbbx?????.Text = dset.Tables("bihin").Rows(increment).Item(14)
    > > txt????.Text = dset.Tables("bihin").Rows(increment).Item(15)
    > >
    > > End Sub
    > >
    > >
    > > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
    > > System.EventArgs) Handles MyBase.Load 'loading the form
    > >
    > > con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
    > > Source=C:\Documents and Settings\Administrator\My
    > > Documents\eileen\eileen's
    > > databases\bihin.mdb"
    > > con.Open()
    > >
    > > sql = "SELECT*FROM bihinTable"
    > > dadapt = New OleDb.OleDbDataAdapter(sql, con)
    > > dadapt.Fill(dset, "bihin")
    > >
    > > con.Close()
    > >
    > > maxrows = dset.Tables("bihin").Rows.Count 'counting the number of
    > > rows
    > >
    > > End Sub
    > >
    > > Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As
    > > System.EventArgs) Handles btnNext.Click 'moving to the next
    > > record
    > > If increment <> maxrows - 1 Then
    > > increment = increment + 1
    > > navigateRecords()
    > > Else
    > > MsgBox("No more rows")
    > > End If
    > > End Sub
    > >
    > > Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As
    > > System.EventArgs) Handles btnPrevious.Click 'moving to previous
    > > record
    > > If increment > 0 Then
    > > increment = increment - 1
    > > navigateRecords()
    > > Else
    > > MsgBox("First record")
    > > End If
    > > End Sub
    > >
    > > Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As
    > > System.EventArgs) Handles btnFirst.Click 'first record
    > > If increment <> 0 Then
    > > increment = 0
    > > navigateRecords()
    > > End If
    > > End Sub
    > >
    > > Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As
    > > System.EventArgs) Handles btnLast.Click 'last record
    > > If increment <> maxrows - 1 Then
    > > increment = maxrows - 1
    > > navigateRecords()
    > > End If
    > > End Sub
    > >
    > > Private Sub btn??_Click(ByVal sender As System.Object, ByVal e As
    > > System.EventArgs) Handles btn??.Click 'place that the update
    > > doesn't work
    > > Dim cb As New OleDb.OleDbCommandBuilder(dadapt)
    > >
    > > dset.Tables("bihin").Rows(increment).Item(1) = txtCD.Text
    > > dset.Tables("bihin").Rows(increment).Item(2) = txt?.Text
    > > dset.Tables("bihin").Rows(increment).Item(3) = cmbbx????.Text
    > > dset.Tables("bihin").Rows(increment).Item(4) = cmbbx????.Text
    > > dset.Tables("bihin").Rows(increment).Item(5) = txtPN.Text
    > > dset.Tables("bihin").Rows(increment).Item(6) = txtSN.Text
    > > dset.Tables("bihin").Rows(increment).Item(7) = cmbbx???.Text
    > > dset.Tables("bihin").Rows(increment).Item(8) = txt??.Text
    > > dset.Tables("bihin").Rows(increment).Item(9) = txtTEL.Text
    > > dset.Tables("bihin").Rows(increment).Item(10) = txt?.Text
    > > dset.Tables("bihin").Rows(increment).Item(11) = txt????.Text
    > > dset.Tables("bihin").Rows(increment).Item(12) = txt????.Text
    > > dset.Tables("bihin").Rows(increment).Item(13) = cmbbx????.Text
    > > dset.Tables("bihin").Rows(increment).Item(14) = cmbbx?????.Text
    > > dset.Tables("bihin").Rows(increment).Item(14) = txt????.Text
    > >
    > > dadapt.Update(dset, "bihin")
    > > MsgBox("updated")
    > >
    > > End Sub
    > >
    > > Private Sub btn????_Click(ByVal sender As System.Object, ByVal e As
    > > System.EventArgs) Handles btn????.Click 'clearing a record
    > > txtCD.Clear()
    > > txt?.Clear()
    > > txtPN.Clear()
    > > txtSN.Clear()
    > > txt??.Clear()
    > > txtTEL.Clear()
    > > txt?.Clear()
    > > txt????.Clear()
    > > txt????.Clear()
    > > txt????.Clear()
    > > End Sub
    > >
    > >
    > >
    > > "Brendan Reynolds" wrote:
    > >
    > >>
    > >> 'Handle' didn't seem to make much sense in the context, 'connection' was
    > >> the
    > >> closest thing I could think of that might make sense in that context. But
    > >> without seeing the code, the connection string, and the SQL, I can only
    > >> guess.
    > >>
    > >> The most likely places to look for an error of this kind are probably the
    > >> connection string, the code that opens the connection, the code that
    > >> assigns
    > >> values to parameters, if any, or the SQL of the update command. In a
    > >> multi-user app another possibility to look into would be concurrency
    > >> errors,
    > >> e.g. the data has changed between the time you retrieved it from the
    > >> database and the time you attempt to update it. If the table you are
    > >> updating has an AutoNumber field, also make sure that you are not
    > >> attempting
    > >> to update that field.
    > >>
    > >> As you can see, there are a number of possibilities. I'm afraid the above
    > >> is
    > >> not an exhaustive list, there are probably quite a few more. If possible,
    > >> it
    > >> might help if you could find a native Japanese speaker to translate the
    > >> error messages.
    > >>
    > >> --
    > >> Brendan Reynolds
    > >> Access MVP
    > >>
    > >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    > >> news:96DE7292-4DF8-48F0-ACA1-59633638ED98@microsoft.com...
    > >> >I don't think it does, but I don't know everything about computers
    > >> >and/or
    > >> > Japanese. Does the message sound familiar? I'm gonna keep reading
    > >> > more
    > >> > about vb and ado maybe I can make it work if I understood it better.
    > >> >
    > >> > "Brendan Reynolds" wrote:
    > >> >
    > >> >> Is the word 'handoru' used to mean anything other than 'handle'? Might
    > >> >> it,
    > >> >> perhaps, be used to mean 'connection'?
    > >> >>
    > >> >> --
    > >> >> Brendan Reynolds
    > >> >> Access MVP
    > >> >>
    > >> >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    > >> >> news:F0855B73-712D-4FBD-AB0F-19E3CBBBE78E@microsoft.com...
    > >> >> > hello david
    > >> >> >
    > >> >> > My database doesn't have any password or anything. I guess one
    > >> >> > problem
    > >> >> > is
    > >> >> > that I am American and working in Japan and I cannot read the error
    > >> >> > messages
    > >> >> > but I will translate it the best that I can
    > >> >> >
    > >> >> > error message:
    > >> >> >
    > >> >> > 'System.Data.OleDb.OleDbException' no handoru(handle) saretenai(not
    > >> >> > or
    > >> >> > isn't) reigai(exception or something abnormal) ga system.data.dll de
    > >> >> > hassei(occurrence or incidence) shimashita(happened)
    > >> >> >
    > >> >> > Does it sound familiar? It's probably a VB problem. Thank you for
    > >> >> > your
    > >> >> > time though.
     
  14. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    I'm sorry, I'm afraid I don't think I'm going to be able to provide the help
    you need. You could try a VB.NET newsgroup, but to be honest I don't think
    you're going to get the type of help you need in any newsgroup. Newsgroups
    are great resources for getting specific answers to specific questions, but
    I think you need more general, step-by-step, tutorial-style coaching, and I
    don't think you'll find that in a newsgroup. I hope you have better luck
    elsewhere.

    --
    Brendan Reynolds
    Access MVP

    "asdf" <asdf@discussions.microsoft.com> wrote in message
    news:C33C6CC9-540A-4572-9EC1-8CDA08A53ED4@microsoft.com...
    > Hello Mr Reynolds and thank you
    >
    > I added your code but I still get error messages. I got a suggestion to
    > put
    > in a try and catch and I copied pasted the suggestion into my program and
    > well.......
    > I've been playing with my program so it has changed a little but here it
    > is
    > the problem section with the exception. All it does when I click the
    > button
    > is I get a message that says "an exception occurred. Please contact your
    > system administrator." What is the next step?
    >
    > Private Sub btnCommit_Click(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles btnCommit.Click
    > con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
    > Source=C:\Documents and Settings\Administrator\My
    > Documents\eileen\eileen's
    > databases\bihin.mdb"
    > If increment <> -1 Then
    > Dim cb As New OleDb.OleDbCommandBuilder(dadapt)
    > Dim dsetNewRow As DataRow
    >
    > dsetNewRow = dset.Tables("bihin").NewRow
    >
    > dsetNewRow.Item("??CD") = txtCD.Text
    > dsetNewRow.Item("???") = txt?.Text
    > dsetNewRow.Item("????") = cmbbx????.Text
    > dsetNewRow.Item("??????") = cmbbx????.Text
    > dsetNewRow.Item("P/N") = txtPN.Text
    > dsetNewRow.Item("S/N") = txtSN.Text
    > dsetNewRow.Item("???") = cmbbx???.Text
    > dsetNewRow.Item("?????") = txt??.Text
    > dsetNewRow.Item("??Tel") = txtTEL.Text
    > dsetNewRow.Item("???") = txt?.Text
    > dsetNewRow.Item("????") = txt????.Text
    > dsetNewRow.Item("????") = txt????.Text
    > dsetNewRow.Item("????") = cmbbx????.Text
    > dsetNewRow.Item("?????") = cmbbx?????.Text
    > dsetNewRow.Item("????") = txt????.Text
    >
    > dset.Tables("bihin").Rows.Add(dsetNewRow)
    >
    > con.Open()
    >
    >
    > Try
    >
    > dadapt.Update(dset, "bihin")
    >
    > Catch ex As OleDb.OleDbException
    > Dim errormessages As String
    > Dim i As Integer
    >
    > For i = 0 To ex.Errors.Count - 1
    > errormessages += "Index# " & i.ToString() &
    > ControlChars.Cr _
    > & "message: " & ex.Errors(i).Message & ControlChars.Cr
    > _
    > & "NativeError: " & ex.Errors(i).Source &
    > ControlChars.Cr _
    > & "source: " & ex.Errors(i).Source & ControlChars.Cr _
    > & "sqlstate: " & ex.Errors(i).SQLState &
    > ControlChars.Cr
    > Next i
    >
    > Dim log As System.Diagnostics.EventLog = New
    > System.Diagnostics.EventLog()
    > log.Source = "my application"
    > log.WriteEntry(errormessages)
    > MsgBox("an exception occurred. Please contact your system
    > administrator.")
    > End Try
    >
    >
    > con.Close()
    > MsgBox("record added to database")
    >
    > End If
    >
    >
    > End Sub
    >
    >
    >
    >
    >
    > "Brendan Reynolds" wrote:
    >
    >>
    >> Try adding the indicated lines to your problem sub. I've marked the new
    >> lines with comments. (I read newsgroup posts in plain text, so I don't
    >> see
    >> any bold or coloured formatting).
    >>
    >> con.Open() ' <= new code
    >> dadapt.Update(dset, "bihin")
    >> con.Close() ' <= new code
    >> MsgBox("updated")
    >>
    >> --
    >> Brendan Reynolds
    >> Access MVP
    >>
    >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    >> news:26873FE0-0CF6-4A36-BB7C-90FD66FF1D51@microsoft.com...
    >> >I don't know much about programming so I have been using code that I
    >> >don't
    >> > completely understand like the CB...I just used what the tutorial says:
    >> >
    >> > "To update the database, you need some extra code. Amend your code to
    >> > this
    >> > (the new lines are in bold, red text):
    >> >
    >> >
    >> > Dim cb As New OleDb.OleDbCommandBuilder(da)
    >> >
    >> > ds.Tables("AddressBook").Rows(inc).Item(1) = txtFirstName.Text
    >> > ds.Tables("AddressBook").Rows(inc).Item(2) = txtSurname.Text
    >> >
    >> > da.Update(ds, "AddressBook")
    >> >
    >> > MsgBox("Data updated")"
    >> >
    >> > (http://www.homeandlearn.co.uk/NET/nets12p9.html)
    >> >
    >> >
    >> > here is most of my code...
    >> >
    >> > Public Class Form1
    >> > Inherits System.Windows.Forms.Form
    >> >
    >> > Dim increment As Integer
    >> > Dim maxrows As Integer
    >> >
    >> > Dim con As New OleDb.OleDbConnection()
    >> > Dim dset As New DataSet()
    >> > Dim dadapt As OleDb.OleDbDataAdapter
    >> > Dim sql As String
    >> >
    >> > Private Sub navigateRecords() 'this is a sub that figures out
    >> > which
    >> > record
    >> > txtCD.Text = dset.Tables("bihin").Rows(increment).Item(1)
    >> > txt?.Text = dset.Tables("bihin").Rows(increment).Item(2)
    >> > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(3)
    >> > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(4)
    >> > txtPN.Text = dset.Tables("bihin").Rows(increment).Item(5)
    >> > txtSN.Text = dset.Tables("bihin").Rows(increment).Item(6)
    >> > cmbbx???.Text = dset.Tables("bihin").Rows(increment).Item(7)
    >> > txt??.Text = dset.Tables("bihin").Rows(increment).Item(8)
    >> > txtTEL.Text = dset.Tables("bihin").Rows(increment).Item(9)
    >> > txt?.Text = dset.Tables("bihin").Rows(increment).Item(10)
    >> > txt????.Text = dset.Tables("bihin").Rows(increment).Item(11)
    >> > txt????.Text = dset.Tables("bihin").Rows(increment).Item(12)
    >> > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(13)
    >> > cmbbx?????.Text = dset.Tables("bihin").Rows(increment).Item(14)
    >> > txt????.Text = dset.Tables("bihin").Rows(increment).Item(15)
    >> >
    >> > End Sub
    >> >
    >> >
    >> > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
    >> > System.EventArgs) Handles MyBase.Load 'loading the form
    >> >
    >> > con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
    >> > Source=C:\Documents and Settings\Administrator\My
    >> > Documents\eileen\eileen's
    >> > databases\bihin.mdb"
    >> > con.Open()
    >> >
    >> > sql = "SELECT*FROM bihinTable"
    >> > dadapt = New OleDb.OleDbDataAdapter(sql, con)
    >> > dadapt.Fill(dset, "bihin")
    >> >
    >> > con.Close()
    >> >
    >> > maxrows = dset.Tables("bihin").Rows.Count 'counting the number
    >> > of
    >> > rows
    >> >
    >> > End Sub
    >> >
    >> > Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As
    >> > System.EventArgs) Handles btnNext.Click 'moving to the
    >> > next
    >> > record
    >> > If increment <> maxrows - 1 Then
    >> > increment = increment + 1
    >> > navigateRecords()
    >> > Else
    >> > MsgBox("No more rows")
    >> > End If
    >> > End Sub
    >> >
    >> > Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e
    >> > As
    >> > System.EventArgs) Handles btnPrevious.Click 'moving to
    >> > previous
    >> > record
    >> > If increment > 0 Then
    >> > increment = increment - 1
    >> > navigateRecords()
    >> > Else
    >> > MsgBox("First record")
    >> > End If
    >> > End Sub
    >> >
    >> > Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As
    >> > System.EventArgs) Handles btnFirst.Click 'first record
    >> > If increment <> 0 Then
    >> > increment = 0
    >> > navigateRecords()
    >> > End If
    >> > End Sub
    >> >
    >> > Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As
    >> > System.EventArgs) Handles btnLast.Click 'last record
    >> > If increment <> maxrows - 1 Then
    >> > increment = maxrows - 1
    >> > navigateRecords()
    >> > End If
    >> > End Sub
    >> >
    >> > Private Sub btn??_Click(ByVal sender As System.Object, ByVal e As
    >> > System.EventArgs) Handles btn??.Click 'place that the
    >> > update
    >> > doesn't work
    >> > Dim cb As New OleDb.OleDbCommandBuilder(dadapt)
    >> >
    >> > dset.Tables("bihin").Rows(increment).Item(1) = txtCD.Text
    >> > dset.Tables("bihin").Rows(increment).Item(2) = txt?.Text
    >> > dset.Tables("bihin").Rows(increment).Item(3) = cmbbx????.Text
    >> > dset.Tables("bihin").Rows(increment).Item(4) = cmbbx????.Text
    >> > dset.Tables("bihin").Rows(increment).Item(5) = txtPN.Text
    >> > dset.Tables("bihin").Rows(increment).Item(6) = txtSN.Text
    >> > dset.Tables("bihin").Rows(increment).Item(7) = cmbbx???.Text
    >> > dset.Tables("bihin").Rows(increment).Item(8) = txt??.Text
    >> > dset.Tables("bihin").Rows(increment).Item(9) = txtTEL.Text
    >> > dset.Tables("bihin").Rows(increment).Item(10) = txt?.Text
    >> > dset.Tables("bihin").Rows(increment).Item(11) = txt????.Text
    >> > dset.Tables("bihin").Rows(increment).Item(12) = txt????.Text
    >> > dset.Tables("bihin").Rows(increment).Item(13) = cmbbx????.Text
    >> > dset.Tables("bihin").Rows(increment).Item(14) = cmbbx?????.Text
    >> > dset.Tables("bihin").Rows(increment).Item(14) = txt????.Text
    >> >
    >> > dadapt.Update(dset, "bihin")
    >> > MsgBox("updated")
    >> >
    >> > End Sub
    >> >
    >> > Private Sub btn????_Click(ByVal sender As System.Object, ByVal e As
    >> > System.EventArgs) Handles btn????.Click 'clearing a record
    >> > txtCD.Clear()
    >> > txt?.Clear()
    >> > txtPN.Clear()
    >> > txtSN.Clear()
    >> > txt??.Clear()
    >> > txtTEL.Clear()
    >> > txt?.Clear()
    >> > txt????.Clear()
    >> > txt????.Clear()
    >> > txt????.Clear()
    >> > End Sub
    >> >
    >> >
    >> >
    >> > "Brendan Reynolds" wrote:
    >> >
    >> >>
    >> >> 'Handle' didn't seem to make much sense in the context, 'connection'
    >> >> was
    >> >> the
    >> >> closest thing I could think of that might make sense in that context.
    >> >> But
    >> >> without seeing the code, the connection string, and the SQL, I can
    >> >> only
    >> >> guess.
    >> >>
    >> >> The most likely places to look for an error of this kind are probably
    >> >> the
    >> >> connection string, the code that opens the connection, the code that
    >> >> assigns
    >> >> values to parameters, if any, or the SQL of the update command. In a
    >> >> multi-user app another possibility to look into would be concurrency
    >> >> errors,
    >> >> e.g. the data has changed between the time you retrieved it from the
    >> >> database and the time you attempt to update it. If the table you are
    >> >> updating has an AutoNumber field, also make sure that you are not
    >> >> attempting
    >> >> to update that field.
    >> >>
    >> >> As you can see, there are a number of possibilities. I'm afraid the
    >> >> above
    >> >> is
    >> >> not an exhaustive list, there are probably quite a few more. If
    >> >> possible,
    >> >> it
    >> >> might help if you could find a native Japanese speaker to translate
    >> >> the
    >> >> error messages.
    >> >>
    >> >> --
    >> >> Brendan Reynolds
    >> >> Access MVP
    >> >>
    >> >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    >> >> news:96DE7292-4DF8-48F0-ACA1-59633638ED98@microsoft.com...
    >> >> >I don't think it does, but I don't know everything about computers
    >> >> >and/or
    >> >> > Japanese. Does the message sound familiar? I'm gonna keep reading
    >> >> > more
    >> >> > about vb and ado maybe I can make it work if I understood it better.
    >> >> >
    >> >> > "Brendan Reynolds" wrote:
    >> >> >
    >> >> >> Is the word 'handoru' used to mean anything other than 'handle'?
    >> >> >> Might
    >> >> >> it,
    >> >> >> perhaps, be used to mean 'connection'?
    >> >> >>
    >> >> >> --
    >> >> >> Brendan Reynolds
    >> >> >> Access MVP
    >> >> >>
    >> >> >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    >> >> >> news:F0855B73-712D-4FBD-AB0F-19E3CBBBE78E@microsoft.com...
    >> >> >> > hello david
    >> >> >> >
    >> >> >> > My database doesn't have any password or anything. I guess one
    >> >> >> > problem
    >> >> >> > is
    >> >> >> > that I am American and working in Japan and I cannot read the
    >> >> >> > error
    >> >> >> > messages
    >> >> >> > but I will translate it the best that I can
    >> >> >> >
    >> >> >> > error message:
    >> >> >> >
    >> >> >> > 'System.Data.OleDb.OleDbException' no handoru(handle)
    >> >> >> > saretenai(not
    >> >> >> > or
    >> >> >> > isn't) reigai(exception or something abnormal) ga system.data.dll
    >> >> >> > de
    >> >> >> > hassei(occurrence or incidence) shimashita(happened)
    >> >> >> >
    >> >> >> > Does it sound familiar? It's probably a VB problem. Thank you
    >> >> >> > for
    >> >> >> > your
    >> >> >> > time though.

    >
     
  15. asdf

    asdf
    Expand Collapse
    Guest

    ok...thank you

    "Brendan Reynolds" wrote:

    > I'm sorry, I'm afraid I don't think I'm going to be able to provide the help
    > you need. You could try a VB.NET newsgroup, but to be honest I don't think
    > you're going to get the type of help you need in any newsgroup. Newsgroups
    > are great resources for getting specific answers to specific questions, but
    > I think you need more general, step-by-step, tutorial-style coaching, and I
    > don't think you'll find that in a newsgroup. I hope you have better luck
    > elsewhere.
    >
    > --
    > Brendan Reynolds
    > Access MVP
    >
    > "asdf" <asdf@discussions.microsoft.com> wrote in message
    > news:C33C6CC9-540A-4572-9EC1-8CDA08A53ED4@microsoft.com...
    > > Hello Mr Reynolds and thank you
    > >
    > > I added your code but I still get error messages. I got a suggestion to
    > > put
    > > in a try and catch and I copied pasted the suggestion into my program and
    > > well.......
    > > I've been playing with my program so it has changed a little but here it
    > > is
    > > the problem section with the exception. All it does when I click the
    > > button
    > > is I get a message that says "an exception occurred. Please contact your
    > > system administrator." What is the next step?
    > >
    > > Private Sub btnCommit_Click(ByVal sender As System.Object, ByVal e As
    > > System.EventArgs) Handles btnCommit.Click
    > > con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
    > > Source=C:\Documents and Settings\Administrator\My
    > > Documents\eileen\eileen's
    > > databases\bihin.mdb"
    > > If increment <> -1 Then
    > > Dim cb As New OleDb.OleDbCommandBuilder(dadapt)
    > > Dim dsetNewRow As DataRow
    > >
    > > dsetNewRow = dset.Tables("bihin").NewRow
    > >
    > > dsetNewRow.Item("??CD") = txtCD.Text
    > > dsetNewRow.Item("???") = txt?.Text
    > > dsetNewRow.Item("????") = cmbbx????.Text
    > > dsetNewRow.Item("??????") = cmbbx????.Text
    > > dsetNewRow.Item("P/N") = txtPN.Text
    > > dsetNewRow.Item("S/N") = txtSN.Text
    > > dsetNewRow.Item("???") = cmbbx???.Text
    > > dsetNewRow.Item("?????") = txt??.Text
    > > dsetNewRow.Item("??Tel") = txtTEL.Text
    > > dsetNewRow.Item("???") = txt?.Text
    > > dsetNewRow.Item("????") = txt????.Text
    > > dsetNewRow.Item("????") = txt????.Text
    > > dsetNewRow.Item("????") = cmbbx????.Text
    > > dsetNewRow.Item("?????") = cmbbx?????.Text
    > > dsetNewRow.Item("????") = txt????.Text
    > >
    > > dset.Tables("bihin").Rows.Add(dsetNewRow)
    > >
    > > con.Open()
    > >
    > >
    > > Try
    > >
    > > dadapt.Update(dset, "bihin")
    > >
    > > Catch ex As OleDb.OleDbException
    > > Dim errormessages As String
    > > Dim i As Integer
    > >
    > > For i = 0 To ex.Errors.Count - 1
    > > errormessages += "Index# " & i.ToString() &
    > > ControlChars.Cr _
    > > & "message: " & ex.Errors(i).Message & ControlChars.Cr
    > > _
    > > & "NativeError: " & ex.Errors(i).Source &
    > > ControlChars.Cr _
    > > & "source: " & ex.Errors(i).Source & ControlChars.Cr _
    > > & "sqlstate: " & ex.Errors(i).SQLState &
    > > ControlChars.Cr
    > > Next i
    > >
    > > Dim log As System.Diagnostics.EventLog = New
    > > System.Diagnostics.EventLog()
    > > log.Source = "my application"
    > > log.WriteEntry(errormessages)
    > > MsgBox("an exception occurred. Please contact your system
    > > administrator.")
    > > End Try
    > >
    > >
    > > con.Close()
    > > MsgBox("record added to database")
    > >
    > > End If
    > >
    > >
    > > End Sub
    > >
    > >
    > >
    > >
    > >
    > > "Brendan Reynolds" wrote:
    > >
    > >>
    > >> Try adding the indicated lines to your problem sub. I've marked the new
    > >> lines with comments. (I read newsgroup posts in plain text, so I don't
    > >> see
    > >> any bold or coloured formatting).
    > >>
    > >> con.Open() ' <= new code
    > >> dadapt.Update(dset, "bihin")
    > >> con.Close() ' <= new code
    > >> MsgBox("updated")
    > >>
    > >> --
    > >> Brendan Reynolds
    > >> Access MVP
    > >>
    > >> "asdf" <asdf@discussions.microsoft.com> wrote in message
    > >> news:26873FE0-0CF6-4A36-BB7C-90FD66FF1D51@microsoft.com...
    > >> >I don't know much about programming so I have been using code that I
    > >> >don't
    > >> > completely understand like the CB...I just used what the tutorial says:
    > >> >
    > >> > "To update the database, you need some extra code. Amend your code to
    > >> > this
    > >> > (the new lines are in bold, red text):
    > >> >
    > >> >
    > >> > Dim cb As New OleDb.OleDbCommandBuilder(da)
    > >> >
    > >> > ds.Tables("AddressBook").Rows(inc).Item(1) = txtFirstName.Text
    > >> > ds.Tables("AddressBook").Rows(inc).Item(2) = txtSurname.Text
    > >> >
    > >> > da.Update(ds, "AddressBook")
    > >> >
    > >> > MsgBox("Data updated")"
    > >> >
    > >> > (http://www.homeandlearn.co.uk/NET/nets12p9.html)
    > >> >
    > >> >
    > >> > here is most of my code...
    > >> >
    > >> > Public Class Form1
    > >> > Inherits System.Windows.Forms.Form
    > >> >
    > >> > Dim increment As Integer
    > >> > Dim maxrows As Integer
    > >> >
    > >> > Dim con As New OleDb.OleDbConnection()
    > >> > Dim dset As New DataSet()
    > >> > Dim dadapt As OleDb.OleDbDataAdapter
    > >> > Dim sql As String
    > >> >
    > >> > Private Sub navigateRecords() 'this is a sub that figures out
    > >> > which
    > >> > record
    > >> > txtCD.Text = dset.Tables("bihin").Rows(increment).Item(1)
    > >> > txt?.Text = dset.Tables("bihin").Rows(increment).Item(2)
    > >> > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(3)
    > >> > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(4)
    > >> > txtPN.Text = dset.Tables("bihin").Rows(increment).Item(5)
    > >> > txtSN.Text = dset.Tables("bihin").Rows(increment).Item(6)
    > >> > cmbbx???.Text = dset.Tables("bihin").Rows(increment).Item(7)
    > >> > txt??.Text = dset.Tables("bihin").Rows(increment).Item(8)
    > >> > txtTEL.Text = dset.Tables("bihin").Rows(increment).Item(9)
    > >> > txt?.Text = dset.Tables("bihin").Rows(increment).Item(10)
    > >> > txt????.Text = dset.Tables("bihin").Rows(increment).Item(11)
    > >> > txt????.Text = dset.Tables("bihin").Rows(increment).Item(12)
    > >> > cmbbx????.Text = dset.Tables("bihin").Rows(increment).Item(13)
    > >> > cmbbx?????.Text = dset.Tables("bihin").Rows(increment).Item(14)
    > >> > txt????.Text = dset.Tables("bihin").Rows(increment).Item(15)
    > >> >
    > >> > End Sub
    > >> >
    > >> >
    > >> > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
    > >> > System.EventArgs) Handles MyBase.Load 'loading the form
    > >> >
    > >> > con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
    > >> > Source=C:\Documents and Settings\Administrator\My
    > >> > Documents\eileen\eileen's
    > >> > databases\bihin.mdb"
    > >> > con.Open()
    > >> >
    > >> > sql = "SELECT*FROM bihinTable"
    > >> > dadapt = New OleDb.OleDbDataAdapter(sql, con)
    > >> > dadapt.Fill(dset, "bihin")
    > >> >
    > >> > con.Close()
    > >> >
    > >> > maxrows = dset.Tables("bihin").Rows.Count 'counting the number
    > >> > of
    > >> > rows
    > >> >
    > >> > End Sub
    > >> >
    > >> > Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As
    > >> > System.EventArgs) Handles btnNext.Click 'moving to the
    > >> > next
    > >> > record
    > >> > If increment <> maxrows - 1 Then
    > >> > increment = increment + 1
    > >> > navigateRecords()
    > >> > Else
    > >> > MsgBox("No more rows")
    > >> > End If
    > >> > End Sub
    > >> >
    > >> > Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e
    > >> > As
    > >> > System.EventArgs) Handles btnPrevious.Click 'moving to
    > >> > previous
    > >> > record
    > >> > If increment > 0 Then
    > >> > increment = increment - 1
    > >> > navigateRecords()
    > >> > Else
    > >> > MsgBox("First record")
    > >> > End If
    > >> > End Sub
    > >> >
    > >> > Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As
    > >> > System.EventArgs) Handles btnFirst.Click 'first record
    > >> > If increment <> 0 Then
    > >> > increment = 0
    > >> > navigateRecords()
    > >> > End If
    > >> > End Sub
    > >> >
    > >> > Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As
    > >> > System.EventArgs) Handles btnLast.Click 'last record
    > >> > If increment <> maxrows - 1 Then
    > >> > increment = maxrows - 1
    > >> > navigateRecords()
    > >> > End If
    > >> > End Sub
    > >> >
    > >> > Private Sub btn??_Click(ByVal sender As System.Object, ByVal e As
    > >> > System.EventArgs) Handles btn??.Click 'place that the
    > >> > update
    > >> > doesn't work
    > >> > Dim cb As New OleDb.OleDbCommandBuilder(dadapt)
    > >> >
    > >> > dset.Tables("bihin").Rows(increment).Item(1) = txtCD.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(2) = txt?.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(3) = cmbbx????.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(4) = cmbbx????.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(5) = txtPN.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(6) = txtSN.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(7) = cmbbx???.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(8) = txt??.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(9) = txtTEL.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(10) = txt?.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(11) = txt????.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(12) = txt????.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(13) = cmbbx????.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(14) = cmbbx?????.Text
    > >> > dset.Tables("bihin").Rows(increment).Item(14) = txt????.Text
    > >> >
    > >> > dadapt.Update(dset, "bihin")
    > >> > MsgBox("updated")
    > >> >
    > >> > End Sub
    > >> >
    > >> > Private Sub btn????_Click(ByVal sender As System.Object, ByVal e As
    > >> > System.EventArgs) Handles btn????.Click 'clearing a record
    > >> > txtCD.Clear()
    > >> > txt?.Clear()
    > >> > txtPN.Clear()
    > >> > txtSN.Clear()
    > >> > txt??.Clear()
    > >> > txtTEL.Clear()
    > >> > txt?.Clear()
    > >> > txt????.Clear()
    > >> > txt????.Clear()
    > >> > txt????.Clear()
    > >> > End Sub
    > >> >
    > >> >
    > >> >
    > >> > "Brendan Reynolds" wrote:
    > >> >
    > >> >>
    > >> >> 'Handle' didn't seem to make much sense in the context, 'connection'
    > >> >> was
    > >> >> the
    > >> >> closest thing I could think of that might make sense in that context.
    > >> >> But
    > >> >> without seeing the code, the connection string, and the SQL, I can
    > >> >> only
    > >> >> guess.
    > >> >>
    > >> >> The most likely places to look for an error of this kind are probably
    > >> >> the
    > >> >> connection string, the code that opens the connection, the code that
    > >> >> assigns
    > >> >> values to parameters, if any, or the SQL of the update command. In a
    > >> >> multi-user app another possibility to look into would be concurrency
    > >> >> errors,
     

Share This Page