Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently November 7th, 2024, 7:26 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Database Search, then update or delete record
PostPosted: April 26th, 2007, 12:52 am 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

On a steep learning curve re: DB functions (using the standard Opus DB actions), I have a question:

There are 2 queries set up so far: the primary one which is on a page OnShow trigger (and, since it is checked for update/change, is available for the update and delete actions) and a second query (which is not checked for update/change) and used only for searching.

Here's the problem: first, the end-user would search for a record to update or possibly delete. When found, this seems to open the record in the second query (which is not set up for update/change), rather than the first. If th end-user then wants to update or delete a record, they can't seem to be able to do this, unless the record, found by searching, is closed and re-opened using the first query: an awkward process at best.

Is there a better way to design the DB functions (using the standard Opus DB actions, not scripting), so that an end-user can seamlessly search for a record and, once open, update it or delete it?

A novice at DB's, I suspect there is an easier way, but I'm missing it.

Any help would be appreciated.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Db
PostPosted: April 27th, 2007, 2:43 am 
Offline

Joined: December 14th, 2004, 5:08 pm
Posts: 55
Location: Holland
Opus: version 8.0
OS: XP, Vista, Windows7, Windows8
System: Intel Corei7-2600 CPU 3.400GHz
The easiest way is to do it in scripting and not under the action tabs.

If you're familiar with the database scripting you can do the following steps

Connect to database
Search for a record through a search variable in the pub
1) selected record will be placed in a variable
2) update or insert record through the same variable
3) select the record again to see update on screen

Cheers


For this message ivisionar has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 27th, 2007, 4:19 am 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks Jim

With some help from Forum colleagues, I had gotten to about the same place, using the standard actions. While I can do some scripting in general, I'm not yet up to speed scripting in DB's.

I seem to have 3 queries set up: one onShow that reads fields, allows for next and previous viewing and delete (it's checked for update/change), one for search, and, one more for update, since that reads the stored record's variable from the search to get the searched for, current record, to update. Even though I'm ending queries in the same buttons after using them, once I search and then update, next and previous won't work again until I exit and re-load the page (page refresh doesn't seem to work). Still can't get delete to work. Add works.

I'm afraid it's still quite a jumble of results. Not very reliable. Logically, it should all work, but doesn't.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 27th, 2007, 9:58 am 
Offline

Joined: December 14th, 2004, 5:08 pm
Posts: 55
Location: Holland
Opus: version 8.0
OS: XP, Vista, Windows7, Windows8
System: Intel Corei7-2600 CPU 3.400GHz
Here is a script example

Cheers

Jim


You do not have the required permissions to view the files attached to this post.


For this message ivisionar has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 27th, 2007, 12:35 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Jim

Thanks for your reply.

I downloaded and opened the sample pub, but because of "error" messages in the script, couldn't run it.

For example, using "go to error," in the ScriptStart script object, the error pointed to:

amountFound = records1.GetNumberOfRecords();

However, as an example of how to set up scripting for DB functions, it will potentially be quite helpful.

Thank you.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 27th, 2007, 9:08 pm 
Offline

Joined: December 14th, 2004, 5:08 pm
Posts: 55
Location: Holland
Opus: version 8.0
OS: XP, Vista, Windows7, Windows8
System: Intel Corei7-2600 CPU 3.400GHz
To run a database publication in scripting you need to add theODBC configuration, see attachment

Cheers

Jim


For this message ivisionar has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 27th, 2007, 9:22 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Jim

I looked for the attachment to this posting and couldn't locate it.

I did, however, set up a page onShow DSN, pointed to the file that you sent, trying to use the same name as in the script (FILEDSN). So far, I'm still getting the same error messages when I run the script.

Possibly, if I can get the attachment, it will have more instructions on setting up the correct DSN.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 28th, 2007, 9:27 pm 
Offline

Joined: December 14th, 2004, 5:08 pm
Posts: 55
Location: Holland
Opus: version 8.0
OS: XP, Vista, Windows7, Windows8
System: Intel Corei7-2600 CPU 3.400GHz
Follow these steps and check under the help file in opus (search under DSN in the script help section)


Create a FileDSN in XP
Go to administrative tools in the control panel
Go to your ODBC source
Create a FileDSN
Use a Microsoft Access Driver (.mdb)
Give the driver the name db1
Select the Access database db1.mdb to make the connection

Start the publication in Opus5XE
Run the pub in preview mode
Close the pub
Check under the database action tab if the db1.mdb points to the root folder (or the folder were you placed db1.mdb)

If all this is correct the pub won't give a error

Just to make sure we run the pub under several systems here in the office and everything is working well


Hope this will help you to get along...

Cheers

Jim


You do not have the required permissions to view the files attached to this post.


For this message ivisionar has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 28th, 2007, 9:36 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Jim

Thanks for your help. I'll gave it a try and still am getting script error messages.

The FILEDSN=db1.dsn is set up and pointed at db1.mdb.

I've attached a screen shot.

Kind Regards


You do not have the required permissions to view the files attached to this post.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 29th, 2007, 2:13 am 
Offline

Joined: December 14th, 2004, 5:08 pm
Posts: 55
Location: Holland
Opus: version 8.0
OS: XP, Vista, Windows7, Windows8
System: Intel Corei7-2600 CPU 3.400GHz
You don't have a database connection under the database action tab...

BR

Jim


You do not have the required permissions to view the files attached to this post.


For this message ivisionar has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 29th, 2007, 4:55 am 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Jim

OK

Finally got it working. Thanks.

I'll review the scripts. May take a while to figure out how to use scripting.

Meanwhile, I'll need to rely on the standard DB actions available (see other posting, zip folder sample).

Update: regarding the .imp in the zip folder (see posting with my attachment above): I tried adding a username in the properties tab>database: "admin," and that seems to have worked. If you add this to username in both places for it on that tab, for the correct DSN, the add and delete then work OK.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 13 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group