Results 1 to 5 of 5

Thread: problem with database

Hybrid View

  1. #1
    Lively Member
    Join Date
    May 12
    Posts
    103

    problem with database

    dear vbforum,
    im writing this thread to ask about updating database automatically

    i want the programme to do this:
    go to guestinfo(database)> then go to guest id from this get the bigest number and add form this number one and placed it in the updating database
    i want

    if you want more infomration write it

    yours,
    paok

  2. #2
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 07
    Location
    India
    Posts
    2,156

    Re: problem with database

    if you want more infomration write it
    yes need more info, any code u tried and what is the problem?
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  3. #3
    PowerPoster
    Join Date
    Jul 06
    Location
    Maldon, Essex. UK
    Posts
    5,386

    Re: problem with database

    Take a look at the MAX Function in SQL. eg
    Code:
    SELECT MAX(columnname) AS maxnumber FROM table

  4. #4
    Lively Member
    Join Date
    May 12
    Posts
    103

    Re: problem with database

    Code:
    Private Sub Command1_Click()
        
        ConnectDB
        
            rs.Open "guestinfo", db, 3, 3
                   
                   rs.AddNew
                        rs(1) = txtFullName
                        rs(2) = txtAddres
                        rs(3) = txtPhoneNo
                        rs(4) = cboGender
                        rs(5) = txtAge
                   rs.Update
            Set rs = Nothing
        db.Close: Set db = Nothing
        
        MsgBox "Successfully added new record!", vbInformation, "Save"
        txtFullName = Empty
        txtAddres = Empty
        txtPhoneNo = Empty
        cboGender = Empty
        txtAge = Empty
        
        LoadData 'to refresh records
        
    End Sub
    for this piece of code how and where i have to write it?

  5. #5
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 08
    Location
    Trivandrum, Kerala, India
    Posts
    7,559

    Re: problem with database


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD Athlon X2 5200+, ASUS Motherboard, 2 GB RAM, 400 GB HDD, Nvidia 8600 GT 512MB, 19.5" TFT(Wide), Creative 5.1 Home Theater

    Social Group: VBForums - Developers from India

    Skills: PHP, MySQL, jQuery, VB.Net, VB6, Photoshop...

Posting Permissions

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