vb queries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yosh29rs
    New Member
    • Feb 2008
    • 20

    vb queries

    please help me over my project. . .
    how to create a program using adodc.as in the case of a library searching and saving accounts. . .
    thanks. . .
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Originally posted by yosh29rs
    please help me over my project. . .
    how to create a program using adodc.as in the case of a library searching and saving accounts. . .
    thanks. . .
    We are not doing assignments/homeworks here. Attempt to create that program and if you have some problems that's the time we can help you. Please observe posting guidelines : )

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Sorry yosh29rs, but TheScripts is strictly English-only. I've deleted your post.

      Comment

      • yosh29rs
        New Member
        • Feb 2008
        • 20

        #4
        Originally posted by lotus18
        We are not doing assignments/homeworks here. Attempt to create that program and if you have some problems that's the time we can help you. Please observe posting guidelines : )
        please help me over the codings.. . . i really need it asap. . .really badly. . .thanks

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          Originally posted by yosh29rs
          please help me over the codings.. . . i really need it asap. . .really badly. . .thanks
          Can you kindly post what you have tried sofar .

          Comment

          • lotus18
            Contributor
            • Nov 2007
            • 865

            #6
            Originally posted by yosh29rs
            please help me over the codings.. . . i really need it asap. . .really badly. . .thanks
            OK, I'll try. Just post some of your codes here : )

            Comment

            • yosh29rs
              New Member
              • Feb 2008
              • 20

              #7
              these are what ive tried.some of the codes doesnt work.thanks for the help

              [CODE=vb]Private Sub cmdClr_Click()
              txtFname = ""
              txtLname = ""
              txtMname = ""
              txtAddC = ""
              txtAddZ = ""
              txtAddB = ""
              txtDate = ""
              txtId = ""
              txtDatebirth = ""
              End Sub

              Private Sub cmdSave_Click()
              Adodc1.Recordse t.AddNew

              'let the fields of the database table hold the value on your textboxes
              AdoNew.Recordse t.Fields("fname ") = txtFname.Text
              AdoNew.Recordse t.Fields("lname ") = txtLname.Text
              AdoNew.Recordse t.Fields("mname ") = txtMname.Text
              AdoNew.Recordse t.Fields("addb" ) = txtAddC.Text
              AdoNew.Recordse t.Fields("addz" ) = txtAddZ.Text
              AdoNew.Recordse t.Fields("addc" ) = txtAddB.Text
              AdoNew.Recordse t.Fields("date1 ") = txtDate.Value
              AdoNew.Recordse t.Fields("id") = txtId.Text
              AdoNew.Recordse t.Fields("dateb irth") = txtDatebirth.Va lue
              'Save the record on the database table
              AdoNew.Recordse t.Update

              'Inform the user
              MsgBox "Add New Successful!", vbInformation, "SUCCESSFUL "

              End Sub

              Private Sub Command4_Click( )
              Unload Me
              End Sub

              End Sub

              Private Sub cmdSaveAdd_Clic k()
              Adodc1.Recordse t.AddNew

              'let the fields of the database table hold the value on your textboxes
              AdoNew.Recordse t.Fields("fname ") = txtFname.Text
              AdoNew.Recordse t.Fields("lname ") = txtLname.Text
              AdoNew.Recordse t.Fields("mname ") = txtMname.Text
              AdoNew.Recordse t.Fields("addb" ) = txtAddC.Text
              AdoNew.Recordse t.Fields("addz" ) = txtAddZ.Text
              AdoNew.Recordse t.Fields("addc" ) = txtAddB.Text
              AdoNew.Recordse t.Fields("date1 ") = txtDate.Text
              AdoNew.Recordse t.Fields("id") = txtId.Text
              AdoNew.Recordse t.Fields("dateb irth") = txtDatebirth.Te xt
              'Save the record on the database table
              AdoNew.Recordse t.Update

              'Inform the user
              MsgBox "Add New Successful!", vbInformation, "SUCCESSFUL "
              txtFname.Text = ""
              txtLname.Text = ""
              txtMname.Text = ""
              txtAddC.Text = ""
              txtAddZ.Text = ""
              txtAddB.Text = ""
              txtDate.Text = ""
              txtId.Text = ""
              txtDatebirth.Te xt = ""


              End Sub[/CODE]
              Last edited by Killer42; Feb 20 '08, 01:27 AM. Reason: Added CODE=vb tag

              Comment

              • lotus18
                Contributor
                • Nov 2007
                • 865

                #8
                [code=vb]

                Private Sub cmdClr_Click()
                Dim ctrl As Control
                For Each ctrl In Me
                If TypeOf ctrl Is TextBox Then
                ctrl.Text=""
                End If
                Next
                End Sub

                Private Sub cmdSave_Click()
                Adodc1.Recordse t.AddNew

                'let the fields of the database table hold the value on your textboxes
                AdoNew.Recordse t.Fields("id") = txtId.Text
                AdoNew.Recordse t.Fields("fname ") = txtFname.Text
                AdoNew.Recordse t.Fields("lname ") = txtLname.Text
                AdoNew.Recordse t.Fields("mname ") = txtMname.Text
                AdoNew.Recordse t.Fields("addb" ) = txtAddC.Text
                AdoNew.Recordse t.Fields("addz" ) = txtAddZ.Text
                AdoNew.Recordse t.Fields("addc" ) = txtAddB.Text
                AdoNew.Recordse t.Fields("date1 ") = txtDate.Text '<<<What's the format of your Date?
                AdoNew.Recordse t.Fields("dateb irth") = txtDatebirth.Te xt '<<<What's the format of your Date?
                'Save the record on the database table
                AdoNew.Recordse t.Update

                'Inform the user
                MsgBox "Add New Successful!", vbInformation, "SUCCESSFUL "

                End Sub

                Private Sub Command4_Click( )
                Unload Me 'Exit Form
                End Sub
                [/code]

                Rey Sean

                I think for getting the date values it is better to use maskededit box, or datepicker : )

                Comment

                • yosh29rs
                  New Member
                  • Feb 2008
                  • 20

                  #9
                  thank you for your kind and concern reply lotus. . .id like also to hear from our experts but it seems that their pretty bush huh

                  Comment

                  • Killer42
                    Recognized Expert Expert
                    • Oct 2006
                    • 8429

                    #10
                    There's something I don't understand about this code. Shouldn't Adodc1 and AdoNew actually refer to the same thing?

                    Comment

                    • lotus18
                      Contributor
                      • Nov 2007
                      • 865

                      #11
                      Originally posted by Killer42
                      There's something I don't understand about this code. Shouldn't Adodc1 and AdoNew actually refer to the same thing?
                      Oh sorry for that, it should be AdoNew : )

                      Comment

                      • Killer42
                        Recognized Expert Expert
                        • Oct 2006
                        • 8429

                        #12
                        Originally posted by lotus18
                        Oh sorry for that, it should be AdoNew : )
                        Could this be the source of some problem?

                        Comment

                        • lotus18
                          Contributor
                          • Nov 2007
                          • 865

                          #13
                          I think so : ) .

                          Comment

                          • yosh29rs
                            New Member
                            • Feb 2008
                            • 20

                            #14
                            our instructor was so mean about the system i made. . .i really dont understan her. . .how cn i improve my programing language?

                            Comment

                            • Killer42
                              Recognized Expert Expert
                              • Oct 2006
                              • 8429

                              #15
                              Originally posted by yosh29rs
                              our instructor was so mean about the system i made. . .i really dont understan her. . .how cn i improve my programing language?
                              Well, one of the most important things in programming is that you must pay attention to the details. For instance, a quick glance at this post shows very sloppy use of English - are you even aware of it. A bit of precision might help. Is your programming as rough as this? The tiniest typo or wrong variable name can have big consequences - for example, see the bug I pointed out in post #10.

                              Also, consider the specific criticisms provided by your instructor. And finally, try tracking down a book or two on things like programming style. I don't think there's any simple way we can tell you how to program "better".
                              Last edited by Killer42; Feb 21 '08, 09:26 PM.

                              Comment

                              Working...