DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: VB 6.0 and database searching

  1. #1
    marnix laureys Guest

    VB 6.0 and database searching


    can somebody help me with a problem
    to search in a database via a VB 6.0 form

    thanks



  2. #2
    dnagel Guest

    Re: VB 6.0 and database searching

    <g> yeah, hire me as a consultant!

    D.

    "marnix laureys" <marnix.laureys@pandora.be> wrote in message news:3cea30f5$1@10.1.10.29...
    |
    | can somebody help me with a problem
    | to search in a database via a VB 6.0 form
    |
    | thanks
    |
    |



  3. #3
    Jim Guest

    Re: VB 6.0 and database searching


    "marnix laureys" <marnix.laureys@pandora.be> wrote:
    >
    >can somebody help me with a problem
    >to search in a database via a VB 6.0 form
    >
    >thanks
    >
    >

    'This will connect you to a database.

    Dim Conn As ADODB.Connection
    Dim rs As ADODB.Recordset

    Dim strData As String
    Dim sSql As String
    Dim sConnectionString As String

    Set Conn = New ADODB.Connection

    sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Access\Database.mdb;Persist"
    Conn.ConnectionString = sConnectionString

    Conn.Open

    Set rs = New ADODB.Recordset

    sSql = "Select * from TableName"

    rs.Open sSql, Conn, adOpenKeyset, adLockPessimistic

    Do While Not rs.EOF

    List1.AddItem rs.Fields("Filed to retrieve").Value
    rs.MoveNext

    Loop

    rs.Close
    Set rs = Nothing

    'Wherever you see Database you need to put in the name of the database your
    working with. TableName is the name of the table in the database your retreiving
    from. Field to retrieve is the field you want to send to the listbox is
    this example.

    ' You have to make a reference to the Microsoft Active X 2.1 Goto Project/References
    then select Microsoft Active X 2.1.

    ' This is very general but it's a good start. If you have anymore questions
    just ask.

    Jim

  4. #4
    If your not going to help, dont waist time Guest

    Re: VB 6.0 and database searching


    "dnagel" <GrandNagel@hotmail.com> wrote:
    ><g> yeah, hire me as a consultant!
    >
    >D.
    >
    >"marnix laureys" <marnix.laureys@pandora.be> wrote in message news:3cea30f5$1@10.1.10.29...
    >|
    >| can somebody help me with a problem
    >| to search in a database via a VB 6.0 form
    >|
    >| thanks
    >|
    >|
    >
    >



  5. #5
    dnagel Guest

    Re: VB 6.0 and database searching

    (WAIST??? How about learn to spell instead of learning to write DB code)

    For goodness sake man... entire volumes have been written on this topic.
    Go out and buy one or two.

    If you haven't even tried it, why should we waste OUR time answering?

    D?

    "If your not going to help, dont waist time" <vb.@127.0.0.1> wrote in message news:3cea6f8a$1@10.1.10.29...
    |
    | "dnagel" <GrandNagel@hotmail.com> wrote:
    | ><g> yeah, hire me as a consultant!
    | >
    | >D.
    | >
    | >"marnix laureys" <marnix.laureys@pandora.be> wrote in message news:3cea30f5$1@10.1.10.29...
    | >|
    | >| can somebody help me with a problem
    | >| to search in a database via a VB 6.0 form
    | >|
    | >| thanks
    | >|
    | >|
    | >
    | >
    |



  6. #6
    Jim Guest

    Re: VB 6.0 and database searching


    "dnagel" <GrandNagel@hotmail.com> wrote:
    >(WAIST??? How about learn to spell instead of learning to write DB code)
    >
    >For goodness sake man... entire volumes have been written on this topic.
    >Go out and buy one or two.
    >
    >If you haven't even tried it, why should we waste OUR time answering?
    >
    >D?
    >
    >"If your not going to help, dont waist time" <vb.@127.0.0.1> wrote in message

    news:3cea6f8a$1@10.1.10.29...
    >|
    >| "dnagel" <GrandNagel@hotmail.com> wrote:
    >| ><g> yeah, hire me as a consultant!
    >| >
    >| >D.
    >| >
    >| >"marnix laureys" <marnix.laureys@pandora.be> wrote in message news:3cea30f5$1@10.1.10.29...
    >| >|
    >| >| can somebody help me with a problem
    >| >| to search in a database via a VB 6.0 form
    >| >|
    >| >| thanks
    >| >|
    >| >|
    >| >
    >| >
    >|
    >
    >

    Have you ever stopped to think that maybe he's a newbie??? I guess you were
    never a beginner!! Must be nice!! Also, money isn’t easily obtained for
    all people. As far as my spelling goes, I guess you never made a typo either….
    Your just a super human… you ass…!

  7. #7
    dnagel Guest

    Re: VB 6.0 and database searching


    | Have you ever stopped to think that maybe he's a newbie??? I guess you were
    | never a beginner!! Must be nice!! Also, money isn’t easily obtained for
    | all people. As far as my spelling goes, I guess you never made a typo either….
    | Your just a super human… you ass…!

    Sure I was a beginner... I learned 6502 assembly language from a book.
    No news groups to help me... I also learned VB and Databse programming from
    books... Starting to see a trend?? Thought so...

    If he doesn't have money for a book, then he can go to the FREE public library
    and check out anything he wants. And for that matter, press F1, there's tons of
    FREE samples, information and conceptual papers in the help and MSDN files.

    I certainly am not here to promote someone else's laziness... Ask anyone
    who answers questions here... They'll all say that they expect the 'asker' has
    at least read what he can, tried and failed at an attempt, and is ready to present
    some code for review, even broken code...

    As far as being a super human, I'm elated that you think so highly of me.

    BTW, I wouldn't have pointed out the misuse of the word waist if you had
    actually posted it in the body of the message with your real name/handle in
    the From field... In my book, that makes you look like some kind of coward.

    D.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center