Results 1 to 3 of 3

Thread: error 91... Only get it running the app on other machines

  1. #1
    Guest

    Angry

    Ok, been banging my head and now I need to ask someone for some help. Hopefully someone will have an idea.

    Have an application that simply reads certain fields out of an Access database and sends that information out to a text file. It uses datepickers so that I can pull out these certain fields based on the date range selected.

    I have Visual Studio with the service pack 4. On my computer (running Win 98) where I am writing the app it works perfect. I used the Package and Development wizard to create an installation program. When I take the install program to another computer with win 98 and 95 (tried 2 different ones) the install program runs fine. In the app I have a button that starts the export, on the other computers, when the button is clicked, I get "error 91, Object variable or With block variable not set".

    Is there something that is missing when the setup program is created? Why is it working on my machine? What do I need to do to the other machines? Just to try things I have installed DCOM 98 and MDAC 2.5 on the other machines. Below is the main part of the code that I have. This works perfectly on my computer.

    Thank you if anyone can give me insight!


    Dim ws As Workspace
    Dim db As Database

    Dim strsql As String
    Dim strDBName As String

    strDBName = "C:\aloha\backoffice\ds\dsdata.mdb"
    Set ws = DBEngine.Workspaces(0) 'use default
    Set db = ws.OpenDatabase(strDBName)

    'Create sql statement
    strsql = "SELECT Customers.LastName, Customers.FirstName,_ Customers.CardNumber,ARTransactions.TransactionReference,_ ARTransactions.TransactionDate,ARTransactions.TransactionTotal INTO [text;database=c:\aloha\].[stjoseph.txt] FROM [Customers]INNER JOIN [ARTransactions] ON Customers.CustomerID = ARTransactions.TransactionCustomerID WHERE ARTransactions.TransactionDate BETWEEN #"

    strsql = strsql & CStr(DTPicker1.Value - 1)
    strsql = strsql & "# AND #"
    strsql = strsql & CStr(DTPicker2.Value + 1)
    strsql = strsql & "#"

    With db
    .Execute strsql
    End With

  2. #2
    New Member
    Join Date
    Sep 2000
    Posts
    4
    When using the package and deployment wizard,
    try building a dependecy for the program, and check
    all the paths for each.
    When the setup is exe, it "should" let you know if there
    is a missing file that cannot be located.
    "?"


  3. #3
    Addicted Member
    Join Date
    Sep 1999
    Location
    Philippines
    Posts
    196
    I think that the error occurs on your SQL statement...have you checked the database driver? Are they the same? You can do this by Going to the control panel and then click on the 32Bit ODBC and then clicj on the Drivers tab...check on the Access version.

    Do you have the directory "C:\aloha" in the other computers?

    Check the date settings of your control panel...the datepickers depend on it. Try using the custom format or FORMAT function in VB.

    hope this helps.

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