Saveing data Into a Access Table

Hi everyone


                My quetion is how would I save Data into a Access table. 

I have a Main Form which holds a TextBox called "TextBox1" and 2 command which are called "CmdView" and "CndSave" it's very simple. "this is a testing Form" 

              I also have a DataForm where all my info is going to be display this DataForm is named "Oscar". This is useing a MS Jets 4.0 connection and is connected to a table in Access called "Test1"

             What I would like to do is when the user click Save all the letters or Number inside the TextBox1 would be save in the Access Table which is called "Test1".  When the user clicks View the information that he/she enter would be displayed on the dataForm. Thank you for taking your time and trying to resolve my Problem.
                                  


Answer this question

Saveing data Into a Access Table

  • TCVMZhen

    Hi Lan


    I need a BIG  favorite if you could Make me a sample of Saving Data into a SQL table. Lan all you have to do is create a project with one command and a TextBox. When the Use clicks on the command button it would take the values from textBox1 and inserted it into the SQL table.Once you have created this Sample and emailed to me, I will review it to see what I was doing wrong. I been trying to do this process for a long time and I'm not able to accomplish this process. Thank you so much!!!!! If you are going to make me a Sample you could email it to me at Oscar8@optonline.net

    Thanks in Advance

  • Snyper_10

    Hi Oscar,
    Here's the sample for update to access table.

    Lan

        Dim OleDbConnection1 As New OleDb.OleDbConnection
        Dim da As New OleDb.OleDbDataAdapter
        Dim ds As New DataSet


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

            Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
    "ocking Mode=1;Jet OLEDB:Database Password=;Data Source=""C:\Program Files\Microso" & _
    "ft Office\OFFICE11\SAMPLES\Northwind.mdb"";Password=;Jet OLEDB:Engine Type=5;Jet " & _
    "OLEDB:Global Bulk Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:Sy" & _
    "stem database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet" & _
    " OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:D" & _
    "on't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False" & _
    ";User ID=Admin;Jet OLEDB:Encrypt Database=False"

            da = New OleDb.OleDbDataAdapter("Select * from customers", OleDbConnection1)

            Dim cb As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(da)
            da.Fill(ds)

            TextBox1.DataBindings.Add("Text", ds.Tables(0), "CompanyName")

        End Sub



        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            ds.Tables(0).Rows(0).EndEdit()
            da.Update(ds)

        End Sub

  • Saveing data Into a Access Table