CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2012
    Location
    Yobe
    Posts
    2

    Using microsoft database control (adodc)

    recordset can't not save,open and delete record,

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Using microsoft database control (adodc)

    If you SEARCH for ADODC, you'll find many people that know that it DOES work.

    If they had a problem, they'd post their CODE, the error message, and the line it's on.
    Code:
    ' Code Tags
    Welcome, btw!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Using microsoft database control (adodc)

    The ADODC does indeed work but I would not use it, ADO Code is a better choice and gives you more control.

    At any rate if it is not working then you have probably set something wrong on the properties of the control.
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Dec 2008
    Location
    Step Into(F11)
    Posts
    465

    Smile Re: Using microsoft database control (adodc)

    I Assume your connection string is Ok .try the following way !
    Code:
     
    Private Sub Command1_Click()
    Adodc1.Recordset.AddNew
    Adodc1.Recordset.Fields("IPID") = Text1.Text
    Adodc1.Recordset.Fields("IPNAME") = Text2.Text
    Adodc1.Recordset.Update 
    End Sub

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Using microsoft database control (adodc)

    You don't even CHECK? That would crash the app if the connection wasn't working!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Dec 2008
    Location
    Step Into(F11)
    Posts
    465

    Talking Re: Using microsoft database control (adodc)

    ok i have tried and everything is working like a charm like Add NewRecord and delete .try the following way ! .

    Code:
     
    Option Explicit
    Private Sub btAddnew_Click()
    Adodc1.Recordset.AddNew
    Adodc1.Recordset.Fields("IPID") = TXTIP.Text
    Adodc1.Recordset.Fields("IPNAME") = TXTIPDETAIL.Text
    Adodc1.Recordset.Update
    End Sub
    Private Sub btDelete_Click()
    Adodc1.Recordset.Delete
    End Sub
     
    Private Sub Form_Load()
    With Adodc1
        .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\JoseProject\ServerMaintenance.mdb;Persist Security Info=False"
        .RecordSource = "Select * from StoreServersDetail"
    End With
         Set TXTIP.DataSource = Adodc1
         Set TXTIPDETAIL.DataSource = Adodc1
         TXTIP.DataField = "ipid"
         TXTIPDETAIL.DataField = "ipName"
    End Sub

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

Featured