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:
I am running VB6 on Windows XP Professional. The database is an Access 2000 database.
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:
Code:
Sub CashUp_Click() isoutofstock = False For n = 1 To MSFlexGrid2.Rows - 1 If ProdDetails(n).ProdStock = 0 Then isoutofstock = True Next If isoutofstock Then Call POrderRaise If POraised And MSFlexGrid2.Rows = 1 Then Cancel_Click: Exit Sub nextReceiptNumber = GetNextNo(1) Set pdb = OpenDatabase(dbName) Set p_rec = pdb.OpenRecordset("TillReceipts") ...
Comment