473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Errors only arise in the compiled exe file when accessing Access database

I have a program that interrogates and modifies an Access database. When I run this program from the VB editor it runs fine. When I make the exe file and run that it crashes saying that the "Object invalid or no longer set". Whilst the exe file is in a diferent folder to that of the source, I have made sure I give the full path names to all files I access. Has anyone else had this problem and got any ideas how to fix it. The crash always occurs at a point when it is trying to acces the database (or so it seems).

I have been trying to fix this for months now but cannot see what he problem is. Like I say it works perfectly until I make the exe file and run that. The section of code which I think is responsible is as follows:
Expand|Select|Wrap|Line Numbers
  1. Sub CashUp_Click()
  2. isoutofstock = False
  3. For n = 1 To MSFlexGrid2.Rows - 1
  4.     If ProdDetails(n).ProdStock = 0 Then isoutofstock = True
  5. Next
  6. If isoutofstock Then Call POrderRaise
  7. If POraised And MSFlexGrid2.Rows = 1 Then Cancel_Click: Exit Sub
  8. nextReceiptNumber = GetNextNo(1)
  9. Set pdb = OpenDatabase(dbName)
  10. Set p_rec = pdb.OpenRecordset("TillReceipts")
  11. ...
  12.  
I am running VB6 on Windows XP Professional. The database is an Access 2000 database.
Apr 20 '07 #1
3 1307
Killer42
8,435 Expert 8TB
That is a bit of an odd one.

Are you sure you're specifying full paths and not partial ones? If you're using a partial (or "relative") path, then it will be dependent on the current path, which could change during execution.
Apr 21 '07 #2
That is a bit of an odd one.

Are you sure you're specifying full paths and not partial ones? If you're using a partial (or "relative") path, then it will be dependent on the current path, which could change during execution.
Hi Killer42

Thanks for your comment. It is an odd one. However, no I have not fallen for that one. I store a full path name with drive ina global variable. I have even ensured that the exe file is in the same folder as the source files so they are both (the compiled and uncompiled forms) run from the same location.

Any other ideas?
Steve
Apr 25 '07 #3
Killer42
8,435 Expert 8TB
Thanks for your comment. It is an odd one. However, no I have not fallen for that one. I store a full path name with drive ina global variable. I have even ensured that the exe file is in the same folder as the source files so they are both (the compiled and uncompiled forms) run from the same location.
Um...

Not really. It sounds like something related to an ActiveX control, but beyond that I'm stumped.

You might put in some logging and/or error handling to track down exactly where it's happening. Also, as a debugging thing, I guess you could try switching around your compile options such as P-Code/native, optimisations, upgrade ActiveX, remove info about unused ActiveX, and so on.
Apr 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mike S. Nowostawsky | last post by:
I am getting this error when I try to run a program in my cgi-bin directory (don't know what I'm still missing to make it work): *** Authentication required! This server could not verify that...
7
by: Brian Sabolik | last post by:
I'm not sure if I've broken any Object Oriented rules or not, but ... I have projects in 2 different solutions that need to use each other's methods. Therefore I may have an "update" method in...
1
by: Hafeez | last post by:
I am having real trouble compiling this code http://www.cs.wisc.edu/~vganti/birchcode/codeHier/AttrProj.tgz The attachment shows errors when compiled using the current version of g++ in a...
12
by: Russ | last post by:
Hello. My new dev machine is running XP Pro. In the past all equipment has only used Windows 2000. I have had a lot of problems getting my projects up and running on the new machine. The current...
4
by: Alex | last post by:
Is there any way to link a table to a front end for reference only (no requirement to edit data) so that the LDB file is not created. I use a number of tables for reference and do not need to edit...
0
by: Andrew Dowding | last post by:
Hi Everybody, I have been looking at problems with my Windows Forms C# application and it's little Jet 4 (Access) database for the last few days. The Windows Forms app implements a facade and...
2
by: Don Isgitt | last post by:
Environment: Server running Redhat 3.2.3-20 on quad Xeon 2.4 Postgresql 7.4 compiled from source (gcc 3.2.3) Application written in Perl (5.8.0) using Tk, DBI and DBD Client accessing DB using...
4
by: Praveen_db2 | last post by:
Hi All I am getting strange errors in my db2diag.log can any one tell me what these errors mean?? Following is the code from my db2diag.log...
13
by: kolmogolov | last post by:
/* Hi, I have removed things irrelevant to reproducing the problem. What's wrong with my code? Thanks in advance for any hint! 1166425362 */ #include <stdio.h> #include <stdlib.h> #include...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.