Results 1 to 14 of 14

Thread: FREE MODULE: How to open a Database in VB (Access, DBF)

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    FREE MODULE: How to open a Database in VB (Access, DBF)

    Hi,

    so many people ask how to open Databases in VB. Here is a example how you can do it. It works 100% and can open Access.MDB and DBF-Files.

    Use this and you will never have questions/problems anymore how to open DBs.

    Franky
    Attached Files Attached Files

  2. #2
    Hyperactive Member Ambivalentiowa's Avatar
    Join Date
    Apr 2002
    Location
    Coming soon to a store near you!
    Posts
    375

    Re: Hi

    Originally posted by Franky
    Deserve this attachment to be on page 1?

    eh?
    -Show me on the doll where the music touched you.

  3. #3
    Junior Member
    Join Date
    Mar 2002
    Posts
    22
    this code for databases is exactly what i was looking for. I understand all of it except the stuff below.


    Code:
    rsLigue.CursorType = adOpenStatic
    rsLigue.CursorLocation = adUseClient
    rsLigue.LockType = adLockPessimistic
    rsLigue.Source = "Select * From [Ligue]"
    rsLigue.ActiveConnection = DB
    rsLigue.Open
    Also, this is the sql i have coded during design time. Do i need to modify at all. Im just wondering because you use square brackets in your sql statement.
    Code:
    SELECT  exam_order,objectives,subject FROM Phase1b where exam_order > 0 AND objectives <> " " order by exam_order asc
    thanx trin

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    hi trin

    it is the first time that I get a reply that I do something right. I used only the brackets to show the table better, but you don't need the brackets.
    Your SQL-statement looks fine to me.

    The code for the recordset rsLigue (french word for league) is to open in the already opened connection the recordset. You can open the recordsets that are in your MDB. Why I used the parameters there is a little homework for you. Check the MSDN , there you find why I did this.

    Franky

  5. #5
    Junior Member
    Join Date
    Apr 2002
    Posts
    30

    Question Alternative rs.source

    Question...

    Can I put a table name in the Recordset.Source instead of an SQL statement?

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    Hi

    I checked the MSDN and there it tells yes.

    Source Property (Recordset) ADO
    Indicates the source for the data in a Recordset object (Command object, SQL statement, table name, or stored procedure).

    Applies To

    Recordset

    Settings and Return Values

    Sets a String value or Command object reference; returns only a String value.

    Remarks

    Use the Source property to specify a data source for a Recordset object using one of the following: a Command object variable, an SQL statement, a stored procedure, or a table name . The Source property is read/write for closed Recordset objects and read-only for open Recordset objects.

    If you set the Source property to a Command object, the ActiveConnection property of the Recordset object will inherit the value of the ActiveConnection property for the specified Command object. However, reading the Source property does not return a Command object; instead, it returns the CommandText property of the Command object to which you set the Source property.

    If the Source property is an SQL statement, a stored procedure, or a table name, you can optimize performance by passing the appropriate Options argument with the Open method call.



    Franky

  7. #7
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    You realise that you could put a link to this thread in your sign bit (see UserCP>Profile) and when you answer any post its there for people to jump to.


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    Hi Ecniv

    slower slower ..... again, what can I do? And how get I a picture like the others have it in my profile?

    Franky

  9. #9
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Click UserCP>Edit Options>Change Avatar (bottom)

    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    Hi Ecniv

    I don't mean the little button pic. I mean the big pics that some users have on every post on the bottom of their post.

    Franky

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    page 1

    ..

  12. #12

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    MDAC 2.7

    I had problems with ADO 2.7 (Microsoft Active X Data Objects 2.7)
    After I used 2.6 the problems was gone.

    Keep this in mind when you install MDAC

    Franky

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    If somebody have Connectionstrings from other DB-types attach it

    Hi,

    If anybody have WORKING connectionstrings for Paradox, XBase and other type of Databases it would be maybe a good idea to attach them to this thread.

    nice greetings
    Franky

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