A2K Check for Existence of Back End File 
Author Message
 A2K Check for Existence of Back End File

Hi,

My database application comprises a split architecture.  The front end
holding all the forms, queries and reports and the back end, Data.mdb,
holding the data.  The front end also connects to another database,
ProductKey.mdb.  ProductKey.mdb holds a product key that is required to run
the application.  This is to try and protect the application, to a certain
degree, from piracy or illegal copying.

The problem:

I'm trying to write a procedure that will test to see if the file,
ProductKey.mdb, actually exists.  If it doesn't a legal notice should be
displayed then the pplication should exit giving no information about the
name or location of ProductKey.mdb.

My attempt, see below,  displays the legal notice and then exits the
application if the file is there or not!  I'm using Access 2000.

Please Help

Thanks

Stu & Nige

On Error GoTo Error_No_CopyControl

    Dim DB As DAO.Database
    Dim RST As DAO.Recordset

    Set DB = CurrentDb()
    Set RST = DB.OpenRecordset("SELECT SocSerReg.CosKey,
SocSerReg.CosKeyNumber, " & _
    "SocSerReg.UnLockNumber, SocSerReg.UnLockCompare FROM SocSerReg; ",
dbOpenDynaset, dbForwardOnly)

Error_No_CopyControl:
    Dim Msg
    Msg = MsgBox("No Product Key.  This copy of Childcare Office Solutions
is not licensed", vbExclamation, & _
  "Childcare Office Solutions")
    DoCmd.Quit



Sun, 28 Sep 2003 03:55:48 GMT  
 A2K Check for Existence of Back End File
Try "Exit Function" or "Exit Sub" (depending whether it's a function or sub)
above the error handling code.

If you don't exit the program will just plow through whatever's below,
whether labeled or not.

Max
www.siliconpublishing.org


Quote:
> Hi,

> My database application comprises a split architecture.  The front end
> holding all the forms, queries and reports and the back end, Data.mdb,
> holding the data.  The front end also connects to another database,
> ProductKey.mdb.  ProductKey.mdb holds a product key that is required to
run
> the application.  This is to try and protect the application, to a certain
> degree, from piracy or illegal copying.

> The problem:

> I'm trying to write a procedure that will test to see if the file,
> ProductKey.mdb, actually exists.  If it doesn't a legal notice should be
> displayed then the pplication should exit giving no information about the
> name or location of ProductKey.mdb.

> My attempt, see below,  displays the legal notice and then exits the
> application if the file is there or not!  I'm using Access 2000.

> Please Help

> Thanks

> Stu & Nige

> On Error GoTo Error_No_CopyControl

>     Dim DB As DAO.Database
>     Dim RST As DAO.Recordset

>     Set DB = CurrentDb()
>     Set RST = DB.OpenRecordset("SELECT SocSerReg.CosKey,
> SocSerReg.CosKeyNumber, " & _
>     "SocSerReg.UnLockNumber, SocSerReg.UnLockCompare FROM SocSerReg; ",
> dbOpenDynaset, dbForwardOnly)

> Error_No_CopyControl:
>     Dim Msg
>     Msg = MsgBox("No Product Key.  This copy of Childcare Office Solutions
> is not licensed", vbExclamation, & _
>   "Childcare Office Solutions")
>     DoCmd.Quit



Sun, 28 Sep 2003 04:09:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. A2k: Controlling a back-end MDB from its FRONT-end MDB

2. A2K Updating Back End with new fields from Front End

3. Checking for the existence of a file

4. How to check for existence of a file on harddisk form OL VBscript

5. Check File Existence?

6. Checking for the Existence of a File

7. Checking for random file existence in Visual Basic

8. Checking for existence of a file???

9. Check for existence of a file?

10. Checking for existence of a file...

11. Check for the existence of a file.

12. Checking the Existence of a File

 

 
Powered by phpBB® Forum Software