CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: source code

  1. #1
    Join Date
    Aug 2001
    Posts
    2

    source code

    Below is the source code for search, add, edit, delete using Microsoft access as my database:
    The object that I have are: Microsoft ADO Data Control 6.0(OLEDB),Microsoft DataGrid Control 6.0(OLEDB),(3)command buttons, (3)textbox. Since I'm using VB6 and ACCESS 2000 in VB6 I already check in the reference the "Microsoft DAO 3.6 Object Library" for me to access the database which I was created in MSACCESS. I also connect the ADODataControl for me to display the record in run-time in short the program was running properly.

    Option explicit
    Dim conmastr As Database
    Dim table1 As Recordset

    Private Sub Form_Load()
    Set conmastr = DBEngine.OpenDatabase(App.Path & "/conmastr.mdb")
    Set table1 = conmastr.OpenRecordset("table1")
    End Sub

    Private Sub cmd_search_Click() (command button)
    Table1.Index = "lastname"
    Table1.Seek "=", Text1.Text
    If table1.NoMatch Then
    MsgBox "record not found", vbInformation
    Else
    Text1.Text = table1!lastname
    Text2.Text = table1!firstname
    Text3.Text = table1!midname
    End If
    End Sub

    Private Sub cmd_save_Click() (command button)
    Table1.addnew
    ********
    ********
    ********
    ********
    Table1.update
    End sub

    Private Sub cmd_delete_Click() (command button)
    Table1.delete
    ********
    ********
    ********
    ********
    Table1.update
    End sub

    Private Sub cmd_edit_Click() (command button)
    Table1.edit
    ********
    ********
    ********
    ********
    Table1.update
    End sub

    Now what if my database was created in foxpro for windows ver.2.6 what will I do. Hope you can give me some instruction on how to do it or some source code inorder for me to run the program just like the one that I introduce a while ago.
    Immediate response will highly appreciated!!!!
    Thank You in advance!!!!!!!!!
    More Power!!!!!!



  2. #2
    Join Date
    Jun 2001
    Location
    Sri Lanka
    Posts
    272

    Re: source code

    Just A Suggestion:
    Create a data source name(DSN) for ur FoxPro Database in ODBC for Windows.
    Refer the Connection in ADO using this DSN
    Good Luck


    If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it

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