473,386 Members | 1,835 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,386 software developers and data experts.

Execute a function at database startup ... how?

Hi. I want to execute a routine, at database startup time, to relink
the backend tables. I have the code for the function, but I don't know
where to invoke it. I tried putting a call to the function in the Open
Event of the MainMenu (which gets displayed at Startup). That seems to
be too late, because I get an error that says that it can't find the
tables (I moved the backend file to a different folder, for testing of
this function).

What event is "kicked off" when the database starts up?

TIA.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
7 6791
My aplogies for the duplicate post. My system went weird here at work
and I didn't know if the original got posted or not. I don't think that
I can delete this post. So, again, my apologies.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #2
SueB wrote:
Hi. I want to execute a routine, at database startup time, to relink
the backend tables. I have the code for the function, but I don't know
where to invoke it. I tried putting a call to the function in the Open
Event of the MainMenu (which gets displayed at Startup). That seems to
be too late, because I get an error that says that it can't find the
tables (I moved the backend file to a different folder, for testing of
this function).

What event is "kicked off" when the database starts up?

TIA.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***


See my reply in your other message
Nov 13 '05 #3
The autoexec macro would run first.

You can use the RunCode command to have it run a function (if it's a Sub,
you'll have to either change it to a public function or create a Sub that
calls it).

HTH,

Bruce

"SueB" <sl*****@verizon.net> wrote in message
news:OE***************@news.uswest.net...
Hi. I want to execute a routine, at database startup time, to relink
the backend tables. I have the code for the function, but I don't know
where to invoke it. I tried putting a call to the function in the Open
Event of the MainMenu (which gets displayed at Startup). That seems to
be too late, because I get an error that says that it can't find the
tables (I moved the backend file to a different folder, for testing of
this function).

What event is "kicked off" when the database starts up?

TIA.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***

Nov 13 '05 #4
Bruce Rusk wrote:
The autoexec macro would run first.


Actually the Open, Load, and Current event of a form designated to open in
startup fire before the Autoexec macro.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #5
That's good to know.

In that case, to resolve the OP's problem, it might make sense to run the
necessary code from Autoexec first, then have Autoexec open the form,
instead of setting a startup form.

"Rick Brandt" <ri*********@hotmail.com> wrote in message
news:iC*******************@newssvr14.news.prodigy. com...
Bruce Rusk wrote:
The autoexec macro would run first.


Actually the Open, Load, and Current event of a form designated to open in
startup fire before the Autoexec macro.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 13 '05 #6
Help ... I have the AutoExec macro calling a function to determine if we
should 'relink' the tables. I didn't really know how to do this, so I
put a variable in a table that I have for User Variables to gate whether
the Refresh Links should take place.

Of course this really won't work if the links have been broken because
the table won't be there. But I forged ahead just to give is try (with
the Back-end and Front-end where there are expected to be).
Unfortunately, when I try to get the variable value (the switch = Y or
N) I get an error that says that I "canceled the previous operation".
Wow - this has got me stumped.

I want to ONLY refresh the links if, when the database opens it can't
find the tables. I want it to be executed via VB code. I like the idea
of the database opening with AutoExec Macro which will run code to
refresh the links and then OpenForm for the MainMenu window.

Any ideas would be REALLY appreciated.

Thanks.
SueB

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #7
hey

if you use ACCESS DATA PROJECTS then you dont have to worry about all
this re-linking BS

no linked tables; all the queries are stored in SQL Server-- it's just
a much better solution

Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
2
by: Indrek Mägi | last post by:
How execute extended proc on stopping ms sql server (it mean before stoping). Is it possible to handle this? Or is in system proc a'la sp_on_stop? Thx
1
by: pginfo | last post by:
Hi, I have had two times problem with pg database corruption. My system: Dual athlon 2.4 1 GB RAM, linux red hat 7.3 reiserFS Also on the system I have cron that every 3 h. make dump and...
0
by: xixi | last post by:
hi, we are using db2 udb v8.1 on win 64 bit with fp3 with type 4 db2jcc.jar driver. when i execute this query , select id, arno01, arcd01, arno16, artx01, armo09, ardy09, arcc09, aryr09,...
4
by: Dalan | last post by:
Perhaps someone can share information on the methods to use to effect the automation process of creating the property to set the AllowBypassKey function. I was directed to:...
3
by: Lyle Fairfield | last post by:
MS-SQL Server utilities Enterprise Manager and Query Analyzer will model almost any MS-SQL object as a simple script file with a default ".sql" extension. But how to "run these files? They are...
5
by: SueB | last post by:
Hi. I want to execute a routine, at database startup time, to relink the backend tables. I have the code for the function, but I don't know where to invoke it. I tried putting a call to the...
1
by: =?Utf-8?B?S2Vubnk=?= | last post by:
I have one bat file that contains a command to startup Java Program. Then, I would like to create a cluster job to call the bat file. In case of one computer is down, another computer can also call...
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.