Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 12:34 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Releasing a Database
PostPosted: July 5th, 2007, 12:39 am 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Hi All,

I have a program that uses a MS Access database file which I will call (program.mdb). I am trying to create a way to allow the user to restore a copy of the database that they have saved in the past, but I can't get my Opus program to release the database that it loaded on the program startup.

This is what I'm now doing from a utilities screen...

Actions: Click a button to do the commands below
1 - End Query
2 - Reset the Variables
3 - Copy the (program.mdb) from the publication folder to a temp folder [this is so they can restore it if they don't want to keep the backed up copy]
4 - delete the (program.mdb) from the main folder
5 - Copy the backed up (program.mdb) to the main folder [From the Backup folder]
6 - GOTO the screen that uses the database, which also has a hidden button with an "On Show" command that queries the database that resides in the main folder.

Does anyone know how to make an Opus program release a database file, so that a different database file can then be opened?

I would appreciate any help.
Thanks
Denn

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 5th, 2007, 9:13 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Denn,

I have a program that makes regular calls to a DB whilst in play. I added a button to delete a file and the file was deleted when I clicked that button so I'm not sure is causing your MDB to be lcoked.

All my DB functions are scripted and not opus actions????

Have you tried manually deleting the file whilst the program is running? If this works, then you could use a little DOS delete program if nothing else works.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 5th, 2007, 3:23 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
mackavi wrote:
Hi Denn,

I have a program that makes regular calls to a DB whilst in play. I added a button to delete a file and the file was deleted when I clicked that button so I'm not sure is causing your MDB to be lcoked.

All my DB functions are scripted and not opus actions????

Have you tried manually deleting the file whilst the program is running? If this works, then you could use a little DOS delete program if nothing else works.

Mack


Good Morning Mack,

The commands when I click on my actions button is to close the database file I am using, and then delete the file, then I have a command that places the next file I want opened into the main folder, but this actions does not happen until I actually close the program. There is a file that access creates when you open an .mdb file. This file is a .ldb I need to find a way to close this file out since it seems to be holding the database open. I was hoping there was a command script that would close the database from Opus so that I don't have to close the program down just to change database files.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 6th, 2007, 9:18 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
I believe that I have not displayed the question properly so I'll try again.

I open a program which uses an .mdb file (MS Access database) on one of the several screens within the program. I go to another screen and from that screen I want to disengage from the database that I have opened on the other screen / shut it down / turn it off / make it not be in use anymore.

Does anyone know how to do that?

I believe it’s going to be something like name.mdb.close(), but I’m (obviously) not sure.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 6th, 2007, 10:42 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Denn,

I'm running another application in Opus that opens an MDB and again I don't get the IDB file created. This only happens IF I open the MDB through access itself.

This program also access the MDB file through scripts and all connections use local variables.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 7th, 2007, 2:49 am 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
mackavi wrote:
Hi Denn,

I'm running another application in Opus that opens an MDB and again I don't get the IDB file created. This only happens IF I open the MDB through access itself.

This program also access the MDB file through scripts and all connections use local variables.

Mack

Hi Mack
That's strange that you're not getting a .ldb file. I've done some research on this lately and found that once a .mdb file is opened a .ldb file is supposed to automatically be created in the same folder that the .mdb file is located. The purpose is to keep up with everyone who is accessing the file so that one individual won't close the file while another is still accessing it (or at least I believe thats what it does).

So far I've not been able to find a way within Opus to release the database file (.mdb). It only releases the file once my program is closed. I have tried every variation I can think of to make it release the .mdb file, without having to close the program. I'm trying to open another file with different information in its place.

Are you doing anything like that with your database? Can you release one and open another in it's place?

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 7th, 2007, 4:10 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
:-(

Have double, double checked this with several of my DB applications. The idb file is not created when accessing the data using the publication. Below is one of the functions I use to retreive some data from the database.

Quote:
function theReadOrders(c)
{
myBranch = 'order'
myLookup = new Array()
myCProductsArray = new Array()
myCPVersionArray = new Array()
myPPurchasedArray= new Array()
myPLicenceArray= new Array()
myPSerialArray= new Array()


var db = new Database("DSN=IRDB;")
var RecSet = db.ExecuteSQL("SELECT * FROM orders WHERE c_name='"+c+"' ORDER BY c_product")
var myCount = 0
myTotalRecords = RecSet.GetNumberOfRecords()

while (myCount < myTotalRecords)

{
myLookup[myCount] = RecSet.c_product + ' ('+RecSet.c_ver+')'+ ' '+initials(RecSet.c_lic,RecSet.c_eval)
myCProductsArray[myCount] = RecSet.c_product
myCPVersionArray[myCount] = RecSet.c_ver
myPPurchasedArray[myCount] = RecSet.c_dop
myPLicenceArray[myCount] = RecSet.c_lic
myPSerialArray[myCount] = RecSet.c_serial


RecSet.NextRecord()

myCount++
}
theScroller()
}


All DB variables are local and the DB is opened each time it's required in a function. There are no DB actions. I even added a delete MDB file and this deletes the file just fine.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 7th, 2007, 7:49 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
mackavi wrote:
:-(

Have double, double checked this with several of my DB applications. The idb file is not created when accessing the data using the publication. Below is one of the functions I use to retreive some data from the database.

Quote:
function theReadOrders(c)
{
myBranch = 'order'
myLookup = new Array()
myCProductsArray = new Array()
myCPVersionArray = new Array()
myPPurchasedArray= new Array()
myPLicenceArray= new Array()
myPSerialArray= new Array()


var db = new Database("DSN=IRDB;")
var RecSet = db.ExecuteSQL("SELECT * FROM orders WHERE c_name='"+c+"' ORDER BY c_product")
var myCount = 0
myTotalRecords = RecSet.GetNumberOfRecords()

while (myCount < myTotalRecords)

{
myLookup[myCount] = RecSet.c_product + ' ('+RecSet.c_ver+')'+ ' '+initials(RecSet.c_lic,RecSet.c_eval)
myCProductsArray[myCount] = RecSet.c_product
myCPVersionArray[myCount] = RecSet.c_ver
myPPurchasedArray[myCount] = RecSet.c_dop
myPLicenceArray[myCount] = RecSet.c_lic
myPSerialArray[myCount] = RecSet.c_serial


RecSet.NextRecord()

myCount++
}
theScroller()
}


All DB variables are local and the DB is opened each time it's required in a function. There are no DB actions. I even added a delete MDB file and this deletes the file just fine.

Mack


Ahh...

I now see where my problem is... I don't know how to write script. I am using the actions available in Opus to connect to an MSaccess database and using DSN / ODBC. There are obviously great benefits by being able to actually write your own scripts. I suppose what I need now is to find a script that will close the database / break the ODBC connection. I feel certain that they has to be a way, after all, when I close the program the connection to the database automatically closes, so there has to be a way to close it without actually closing the program. I have everything else covered, all I need at this point is to break that connection.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 7th, 2007, 8:33 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Hi Denn,
Maybe this post will help to close the database.

viewtopic.php?t=853&highlight=disconnect

cheers
Paul


For this message Paul has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: July 7th, 2007, 9:22 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
paul wrote:
Hi Denn,
Maybe this post will help to close the database.

viewtopic.php?t=853&highlight=disconnect

cheers
Paul


Thanks Paul,

I had been searching for something like that, but had not found it. I will try using it and see if I can make it work.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 27th, 2007, 3:18 pm 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
I use script for all database and a .Idb file is always created while the publication is running and left even after publication is closed.

Am I doing something wrong?


For this message josephroddy has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 27th, 2007, 5:04 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
josephroddy wrote:
I use script for all database and a .Idb file is always created while the publication is running and left even after publication is closed.

Am I doing something wrong?


No you are not. The ldb file is created automatically when you are using the database. I believe it stands for "Lock Data Base" and I also believe the point is to let only one person use the database at a time which prevents data from being lost. It would be hard for two people to open one file and insert information into it at the same time.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Releasing a Database
PostPosted: March 26th, 2013, 8:54 pm 
Offline

Joined: May 25th, 2008, 4:57 pm
Posts: 355
Location: Ireland
Opus: Pro 9.75
OS: Windows 10
System: MacBook Pro (Intel 2020)
Is it possible to close and release the database via OpusScript so the ldb file isn't left behind when you're talking to an Access Database.

I remember looking into this a while ago but revisited it over the weekend.

Luke

_________________
Opus Pro 9.75 on MacBookPro (2020 Intel) running Parallels 19 with Windows 10 (x64)


For this message lmc has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Releasing a Database
PostPosted: March 26th, 2013, 9:52 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
lmc wrote:
Is it possible to close and release the database via OpusScript so the ldb file isn't left behind when you're talking to an Access Database.

I remember looking into this a while ago but revisited it over the weekend.

Luke


Luke,

Scripting is not my forte'. Your question is one for Mackavi. Sometimes I wonder if he is the person who actually invented scripting he's so good at it.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Releasing a Database
PostPosted: March 27th, 2013, 12:22 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
It's not created by opening the database, it's created when you execute SQL against a global variable.

Either use a local variable like my examples above or assign a null value to the variable when you've finished.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : lmc


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group