Alpha Video Training
Results 1 to 11 of 11

Thread: Variable type mismatch

  1. #1
    Barb Hill
    Guest

    Default Variable type mismatch

    Hi all,

    I have an A5V5 Home Edition application that tracks donations and prints various reports. One of them is a deposit report that requires the data to be manipulated before it is printed.

    To do this I use an empty table that has the desired structure and just write the data that table and then run the report. The report is called from a script that does all the work.

    The table is populated correctly. The report however will not run. If I run it from the Control Panel after the script has run, it runs correctly.

    The script dies on the following line:
    :Report.preview("Grouped Deposit")
    The error is 'variable type mismatch'.

    This is not the most helpful error message! A variable name would be nice. I suspect it is a conflict between the report and the script. I have checked all the tables that are opened looking for a field that might have the same name but be of a different type.

    I have checked all the variables in the report to ensure that when they refer to a field they include the table reference just in case. I have checked the script for variable names that might conflict with the report. I have used debug to look at as many variables as I can think of. I have checked the grouping for the report, the total fields, etc etc.

    Does any one have any idea what else I should be looking for????

    Any help is greatly appreciated.

    Barb Hill

  2. #2
    Member
    Real Name
    Doug Page
    Join Date
    Jan 2002
    Location
    Vancouver, BC Canada
    Posts
    963

    Default RE: Variable type mismatch

    Hi Barb,

    Not sure why this does not work but I did notice that Report.preview() is now an obsolete function. You might try the replacement PREVIEW_REPORT() function and see if it clears the problem.

    Doug

  3. #3
    Barb Hill
    Guest

    Default RE: Variable type mismatch

    Thanks Doug.

    I replaced the function but still get the same error. No doubt it is something obvious that I'm skipping over when debugging.

    Barb

  4. #4
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,644

    Default RE: Variable type mismatch

    Barb

    What build level are you on?

    Check for updates from the help - check for updates.

  5. #5
    Barb Hill
    Guest

    Default RE: Variable type mismatch

    Thanks. I did that before any thing else.

    Barb

  6. #6
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,644

    Default RE: Variable type mismatch

    Barb

    Can you zip the database and post it or email it directly?

  7. #7
    Barb Hill
    Guest

    Default RE: Variable type mismatch

    Al,

    Thanks. I can do that. I will have to change the data before I zip it and send it to you. It is my client's
    contact list so I can't send it as is. It will be later tonight before I can get this done.

    I would prefer emailing it to you. Can I do that from here? If not where can I send it to?

    Thanks for you kind offer.

    Barb

  8. #8
    "Certified" Alphaholic
    Real Name
    Peter Wayne
    Join Date
    Apr 2000
    Posts
    1,728

    Default RE: Variable type mismatch

    I'm not sure whether this matters, but did you close the table in the script before calling on report.preview()? And are the variables in the script and report declared as local variables, shared variables or global variables?

  9. #9
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,644

    Default RE: Variable type mismatch

    Barb

    I sent a direct email to you regarding how to transfer the zip file.

    Otherwise clicking on a person's name as listed in the phorum should start your email client with an email addressed to that person.

    If you didn't get the email I sent to you, respond to this message or email to alb@bookwood.com

  10. #10
    Barb Hill
    Guest

    Default RE: Variable type mismatch

    Thanks to all for your suggestions. The problem has... gone away.

    In addition to checking variables all over the place, I also updated the indexes just in case. No luck. I was preparing to send the database off for Al to look at and I copied it to another computer. I started the application (in the full edition) and it worked. I wondered if it was the difference between the home and full edition so I made a copy on the original computer and ran it with the home edition. The copy worked fine but the original did not.

    This seems to me that there was something a bit off in the database that was corrected in the copying. Any ideas? Is there a utility to repair databases in A5V5?

    Barb

  11. #11
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,173

    Default RE: Variable type mismatch

    Barb

    I would sound by your fix that there was some corruption in the layout. One utility included in A5 is the ability to compact the database. When you make edits and other changes to a report or other layout, the old layout design code is marked for deletion but not removed. If the database is not compacted, eventually this "junk" accumulates and can cause problems. The solution is to periodically "compact" the database when making design changes, which removes the unused code. Database Compact is available from the control panel menu under "File"

    Jerry

Similar Threads

  1. variable type mismatch
    By Ruth Asfaw in forum Alpha Five Version 5
    Replies: 6
    Last Post: 01-20-2005, 08:49 AM
  2. Action Script-Variable Type Mismatch
    By Ed Merritt in forum Alpha Five Version 5
    Replies: 4
    Last Post: 04-19-2004, 09:48 PM
  3. Variable type mismatch
    By dchiass in forum Alpha Five Version 5
    Replies: 2
    Last Post: 04-02-2004, 04:35 AM
  4. variable type mismatch
    By hcdoe in forum Alpha Five Version 5
    Replies: 4
    Last Post: 01-26-2004, 03:26 PM
  5. Variable type mismatch
    By Anis in forum Alpha Five Version 4
    Replies: 7
    Last Post: 02-16-2001, 08:02 PM

Bookmarks

Posting Permissions

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