Results 1 to 12 of 12
  1. #1
    Join Date
    Jul 2004
    Posts
    494

    Unanswered: How to enable database access with VB6?

    I started a program that would require me to use a database that I've used before. How can I enable it for Visual Basic 6?

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    This is a pretty broad topic.

    What type of database is it? (Oracle, SQL Server, Access, MySQL, ???)

    How many users will ever need to access the database simultaneously?

    What sort of data access is required? (Just a view of a few tables? Parent-child relationships? Updates of the data? Inserts of new data?)

    What sort of response time is needed?

    If it's a multi-user database, how busy is your network?

    As a general rule, try to avoid data controls, as they are inflexable, and are often resource intensive. Instead, use data objects, preferably Active-X Data Objects (ADO)

    This will entail more coding than just slapping some controls on a form, but, in the long run, you will be a lot happier with the results.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Jul 2004
    Posts
    494
    Database: MSAccess 2000
    # of users: 1 (I intend to build a personnal program. Maybe I can distribute on CD)
    sort of data access: I think it's called parent/child though I haven't developped to that extent. It's on the bible. 66 books are on 66 seperate tables. I made an extra table inserting 66 book names and linked them but I don't know if it will work properly. If this is not the proper place to discuss then I'll use one table to test the code right now.
    Insert new data? I think there were a couple of verses missing, which I will need to update. But besides that, no other insersion.
    response time: I don't know what that means.

    Thanks for your inquiries.

  4. #4
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Response time: When the user queries the database, what will the required response time be for a data lookup. In some situations, sub-second response times are required. In others, longer delays can be tolerated. The response time specification can have a great deal of bearing on the database design.

    In your case, the data will be almost entirely textual, which is one of the more time consuming searches to perform. So, if you needed sub-second response times (data being returned in less than one second) you would need to look very closely at your database design. If you need to be able to search by single words, you would need a very large index to support a fast search response.

    What are your thoughts regarding the table design? A Table of Chapters, with chapter number, chapter name, comments, etc., with a table of Verse linked to the Chapter table, and a table of Sentences linked to the Chapter table? If you want to avoid tediously long text searches when querying for single word, you'll probably want to add a lookup table with all words that are 4 or more letters in length. The table would have files like Word, Chapter, Verse, (and even sentence if you wanted to break it down that far). The Primary key for the field would be a compound one, with word, chapter and verse (and sentence too, possibly) as the component fields for the primary key. In addition, you'll want to have an index on just the word field. By building a lookup table this way, you could easily and quickly provide a list of all locations where a given word shows up. However, you should probably filter the word list after it's created, so as to remove common words (thee, thou, etc.) in order to slim down the table. In addition, you should also search for proper names (first letter capitalized whan not the first word of a sentence,) and include them even when they're shorter than 4 letters.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  5. #5
    Join Date
    Jul 2004
    Posts
    494

    My intention for this is...

    I want to make a bible program (do you call this a search engine? or is that for the internet only?) is to search a combination of both numbers and words simultaneously. Because I've noticed that at a certain number (book#, chapter#, verse#) certain words reoccur. So my aim is to search further by computer.

    What I have is 7 fields:

    id book spoke book_title chapter verse text_data

    I want to insert 6 checkboxes, leaving out the id.

    Then 2 radio buttons:
    search the entire bible
    or select the books individually (opens up 66 books)

  6. #6
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    It looks like you're designing the program before the data structure is designed.

    It seems to me as if you need to index every word in the Bible to it's location within the bible.

    So, your base table structure could include the book, chapter, verse, and versetext. And it would be indexed by the numeric values of the book, chapter, and verse. You will probably want a reference table of book numbers to book titles.

    The lookup (search) table would hold the word, the book, chapter, and verse numbers, and an offset into the versetext where the word is located. It's possible that the same word will appear more than once for a given verse, so it would have to have a record in the lookup table for each and every occurrance. Again, this table would have a compound primary key, and should be indexed by word, by word and book, by word, book, and chapter, and by word, book, chapter and verse.

    This means that the lookup table and the associated indexes will be quite a bit larger than the Bible table; on the order of two to five times as large, IMO.

    Your first task would be to write an app that creates a list (table) of all the unique words in the bible.

    Then, if you haven't alsready done so, you'ld need to create the Bible database base structure table and populate it.

    Then, using the unique words list, you'll need to select VerseText from the table where versetext like '%YourWord%' for every unique word, and loop through the versetext, generating a record for every offset into the versetext. Repeat for every unique word.

    Once all the table generation and population work is done (and I would use a separate program for this) THEN you could actually get down to writing your front-end application for analysis.

    FYI. Give me a few days to locate the project & ZIP it up, but I wrote an app that populates a dictionary table by processing a text file. If the word is already in the dictionary, it doesn't try to add it again. When it's done, you end up with a list of all the unique words in the text file in question. When I processed the Lord of the Rings trilogy, I ended up with about 18,000 unique words.
    Attached Files Attached Files
    Last edited by loquin; 07-28-04 at 21:23. Reason: Found the project quicker than I thought...
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  7. #7
    Join Date
    Jul 2004
    Posts
    494

    What method should I use?

    Is there any way to do this? Any tutorial on this on the web?
    Your first task would be to write an app that creates a list (table) of all the unique words in the bible.

  8. #8
    Join Date
    Jul 2004
    Posts
    494

    is the zip supposed to work?

    If it's supposed to work, it says:

    Compile Error: can't find project or library.
    pressing on "OK" "References wordlist.vbp" pops up with the first 5 boxes checked and the highlighted edit view says.
    fcnDB As ADODB.Connection

  9. #9
    Join Date
    Jul 2004
    Posts
    494

    Missing:Microsoft ActveX Data Objects 2.5 Library

    The Locaion says C:\WINNT\SYSTEM32\msado15.dll
    I searched drive C for such a dll and couldn't find it. But there was a Msado15.idl

    I have WIN98SE by the way.

  10. #10
    Join Date
    Jul 2004
    Posts
    494

    To keep you up to date...

    I did
    Copy the dll from the cd and paste it in system32 and
    Run: regsvr32 msado15.dll

    And now it says:
    Run-time error '-2147467259 (80004005)':
    [DBNMPNTW]Specified SQL server not found.

  11. #11
    Join Date
    Jul 2004
    Posts
    494

    didn't have

    Didn't have Microsoft ActiveX Data Objects Library 2.5. I had 2.1.

  12. #12
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    If you download the latest MDAC from microsoft & install it, you should be able to use a later version of ADODB library without problems.

    Also, in the form code, in the form level declarations, update constant fstrConn to match YOUR sql server service name and database name.

    You'll also need to update table names, possibly. I had a dictionary table with a word field (25 character varchar, I believe) a word length numeric field, and a description field. You will need to adjust the app to fit your database. The app expects that the word field be the primary key for the table.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

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