Results 1 to 7 of 7

Thread: [RESOLVED] Access Database write Problem

  1. #1

    Thread Starter
    Hyperactive Member Skatebone's Avatar
    Join Date
    Jan 2009
    Location
    Malta
    Posts
    279

    Resolved [RESOLVED] Access Database write Problem

    Ok i fixed my problem now but what's happening is that the data is always being overwrited. I mean there is only one row which is constantly being overwrited

    Code:
    Public Class Form1
    
        Private Sub UpdateTable(ByVal Details As String())
            Dim DataSet As New LoginServerDataSet
            Dim Adapter As New LoginServerDataSetTableAdapters.DetailsTableAdapter
            Dim Manager As New LoginServerDataSetTableAdapters.TableAdapterManager
    
            Manager.DetailsTableAdapter = Adapter
            DataSet.Details.Rows.Add(Details)
            Manager.UpdateAll(DataSet)
    
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            UpdateTable({"1", "Name3", "Pass"})
        End Sub
    
    End Class
    Thanks in advance =]
    Last edited by Skatebone; Feb 15th, 2011 at 12:40 PM.
    Life runs on code

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Access Database write Problem

    Hmmmm.... classic example of ells being in your hovercraft. Try removing them...

    We're not psychic here... quite honestly I'm not sure how that rumor ever got started... Normally we see one of two types of posts, and rarely ever the third kind... the first kind are the ones that mention what the error is but not the code. The second kind are the ones that give us the code but not what the error is, or what line it happens on. The third kind is the most rarest of all... the kind that give all of the details, the problem ,the error, the code, what has been tried, what doesn't work and what does work. Guess where yours falls? Type 2. If you want a better answer, you'll need to make it a type 3 posting....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Hyperactive Member Skatebone's Avatar
    Join Date
    Jan 2009
    Location
    Malta
    Posts
    279

    Re: Access Database write Problem

    Sorry Dude I just had a problem but while I was writing the post I remembered something and tried to fix it. Now I did and got a new problem :[
    Life runs on code

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Access Database write Problem

    OK.... that link I mentioned in my signature? NOW would be a good time to check it out...see if it's something that applies in this situation.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Hyperactive Member Skatebone's Avatar
    Join Date
    Jan 2009
    Location
    Malta
    Posts
    279

    Re: Access Database write Problem

    If you mean the search, to be honest I did search. I usually though like fixing things myself and not finding them ready. Its my fault because I didnt put my question properly.

    Ok first of all here is my code:

    Code:
    Public Class Form1
        Dim DataSet As New LoginServerDataSet
        Dim Adapter As New LoginServerDataSetTableAdapters.DetailsTableAdapter
        Dim Manager As New LoginServerDataSetTableAdapters.TableAdapterManager
    
        Private Sub UpdateTable(ByVal Details As String())
    
            DataSet.Details.Rows.Add(Details)
            Manager.UpdateAll(DataSet)
    
        End Sub
        Private Sub LoadTable()
    
            Dim reader As New DataTableReader(DataSet.Details)
            DataSet.Load(reader, LoadOption.OverwriteChanges, DataSet.Details)
    
        End Sub
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            Manager.DetailsTableAdapter = Adapter
    
        End Sub
        
    End Class
    Edit: I cant manage to load the data :S Should I create a virtual table and load it in it? Thanks in advance
    Last edited by Skatebone; Feb 15th, 2011 at 02:56 PM.
    Life runs on code

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Access Database write Problem

    my bad... I think i got my threads crossed...
    the link I thought I had mentioned was this one: http://msdn.microsoft.com/en-us/libr...89(VS.80).aspx

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7

    Thread Starter
    Hyperactive Member Skatebone's Avatar
    Join Date
    Jan 2009
    Location
    Malta
    Posts
    279

    Re: Access Database write Problem

    Thanks tg I managed on my own
    Last edited by Skatebone; Feb 15th, 2011 at 03:32 PM.
    Life runs on code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width