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

Thread: HELP PLS

  1. #1
    Join Date
    Dec 1999
    Location
    MALAYSIA
    Posts
    5

    HELP PLS

    how to convert the access database to show in the visual basic? (i mean the code)
    somebody pls help, i am a beginner here. thanks alot


  2. #2
    Join Date
    Feb 2000
    Location
    South Carolina, US
    Posts
    36

    Re: HELP PLS

    Dim DB As Database
    Dim RS As Recordset
    Dim theData(100) As String ' when full, empty and continue
    Dim counter As Long

    Dim x As Long

    Dim DB As Database
    Dim RS As Recordset
    Set DB = Nothing
    Set DB = OpenDatabase("C:\accessdb.mdb", False, False, ";pwd=123456")
    'opens database C:\ACCESSDB.MDB with password 123456
    Set RS = DB.OpenRecordset("SELECT * FROM TheTable")
    RS.MoveFirst
    counter = 0
    While Not RS.EOF
    counter = counter + 1
    theData(counter) = RS!Name
    RS.MoveNext
    Wend
    RS.Close
    DB.Close

    For x = 1 To counter
    MsgBox theData(x)
    Next x

    'This should display all "Name" in "TheTable"
    '(But it only handles 100 before running out of
    'room in the array)


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