Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Database and script does not work after publishing
PostPosted: November 25th, 2004, 4:24 pm 
Offline

Joined: November 25th, 2004, 4:04 pm
Posts: 6
Location: Canada
Hi,

My publication uses a database and some scripts. Everything works flawlessly on my development machine but when I publish it, none of the functions calling the database, including the scripts, work.

To test the publication, I installed it in its published form, that is as an .exe file, along with the database on my test machine without any success.

I then installed Opus Pro on my test machine and copied all the relevant files from my publication. Everything works but the functions accessing the database, just like the .exe.

What am I doing wrong?

Thanks for helping!

Claude


For this message Claude Dionne has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 25th, 2004, 5:26 pm 
Offline

Joined: October 25th, 2004, 3:09 pm
Posts: 32
What database are you using?
What Operating system is the test machine?


For this message Tony Coleman has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 26th, 2004, 1:27 am 
Offline

Joined: November 25th, 2004, 4:04 pm
Posts: 6
Location: Canada
My development machine runs under Windows XP Home. I tested the published .exe on two different machine, one running under Windows XP Home and the other under Windows 98 SP2.


For this message Claude Dionne has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 26th, 2004, 11:24 am 
Offline

Joined: October 25th, 2004, 3:09 pm
Posts: 32
Are you using Access or something else? If you are using access then can you check that the ODBC driver you set up in the dsn is "Microsoft Access Driver (*.mdb)" and not "Driver do Microsoft Access (*.mdb)". The second version only appears in Windows 2000/XP and not in Windows 98/ME.

What version of Opus are you using?
Are you using a file DSN of a system DSN?


For this message Tony Coleman has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 26th, 2004, 3:58 pm 
Offline

Joined: November 25th, 2004, 4:04 pm
Posts: 6
Location: Canada
Hi Tony,

First, I should have been more explicit in my previous message. I tested the published version (.exe) on a Windows 98 and on a Windows XP machine, different than my development machine.

I also installed Opus Pro and all the files relative to my publication on that Windows XP test machine.

Tony Coleman wrote:
Are you using Access or something else? If you are using access then can you check that the ODBC driver you set up in the dsn is "Microsoft Access Driver (*.mdb)" and not "Driver do Microsoft Access (*.mdb)". The second version only appears in Windows 2000/XP and not in Windows 98/ME.

I use an Access database and my first error was to use the wrong driver, that is "Driver do Microsoft...". But even on my Windows XP test machine, this doen't work.

I guess that I can change this driver but how can I do it without loosing the references in my publication?

Tony Coleman wrote:
What version of Opus are you using?

I'm using Opus Pro version 2.6 [2002 sr6].

Tony Coleman wrote:
Are you using a file DSN of a system DSN?

You got me on this one! What's the difference between a file DSN and a system DSN?

Thanks for helping!


For this message Claude Dionne has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 26th, 2004, 5:05 pm 
Offline

Joined: October 25th, 2004, 3:09 pm
Posts: 32
Quote:
I guess that I can change this driver but how can I do it without loosing the references in my publication?

Go into control panel and select your dsn then select configure which will bring up another dialog. In there click advanced and select Driver in the list them you can edit the value(make sure you don't make a mistake typing in the correct driver or it still won't work). The other way is just to delete the dsn and add it back again with the same name.

Quote:
What's the difference between a file DSN and a system DSN?

A file dsn stores the ODBC information in a file and the system ones store the data in the registry. The reason I asked is that Opus 2.x the file dsn data seemed to get corrupted and then the database would not connect. You can fix this by going to the database tab in publication properties selecting your dsn and clicking remove. Then preview your publication making sure a database action/script is run and the ODBC setting in Opus will be refreshed and it should then work.

If after doing the above the publication still does not work can you send it to support@digitalworkshop.com and we will try to find the problem.


For this message Tony Coleman has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 26th, 2004, 11:12 pm 
Offline

Joined: November 25th, 2004, 4:04 pm
Posts: 6
Location: Canada
Ok! Almost everything is working now! Let me explain.

I've been working on this publication for some time now in my spare time. I tried to publish it lately and this is how I realized that it was not working in it's published form.

I found out that I'm using two DSN files in this publication. One is used everywhere I defined an "Action" in the publication and the other is used specifically by a script.

I deleted both DSN files and configured new ones with the same name but with the right driver this time. I then started the publication and made sure that both DSN files were called at least once (I inserted Debug.trace statements to verify this).

I then published the publication and tested it on my three machines. Everything works but the specific DSN used by the script.

This script loads a list of words: this part of the script works. Then when the user click on a word a series of records should be retrieved from the database. This does not work. So that DSN does not work in the published form of the publication but it does work in Opus Pro at development time.

Do you still want me to send the publication or do you have any hint?

Thank you for helping.


For this message Claude Dionne has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 29th, 2004, 11:29 am 
Offline

Joined: October 25th, 2004, 3:09 pm
Posts: 32
Quote:
Do you still want me to send the publication or do you have any hint?


I can't see any reason why it would not work so can you send it to support.


For this message Tony Coleman has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 30th, 2004, 4:49 pm 
Offline

Joined: November 25th, 2004, 4:04 pm
Posts: 6
Location: Canada
As I told you in a previous message, my publication is very large. So I extracted one page which uses the script causing the problem and I made a publication with that only page.

When the publication starts, it loads 5 words with OpusPro search functions and writes them in the left column of the page. This procedure takes place in the 'loadKeywords()' function of the script.

By clicking on one of those words, a series of records should be retrieved and some data writen in the right column of the page.

The 'setKeyword()' function is called when clicking on a word. It then calls the 'setPageList()' function which retrieves the data from the database and writes it to the right column of the page.

That's all there is to it for now. The script is an exact copy of the script used in the original publication.

Everything works in OpusPro but not as a compiled publication.

The zipped file is only 30k in size.

Thank you very much for helping!

Claude


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


For this message Claude Dionne has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 30th, 2004, 5:10 pm 
Offline

Joined: October 25th, 2004, 3:09 pm
Posts: 32
The problem is this line.

var db = new Database("FILEDSN=" + SYSTEM_PUBLICATION_DIR + "mm_Script.dsn");

I got the publication to work by changing the line to

var db = new Database("FILEDSN=C:\\Documents and Settings\\Claude\\Mes documents\\Mes livres\\Ma maison est malade\\mm_Script.dsn");


In the published file the dsn files are ignored and Opus uses the data it has stored in the publication to connect the the database. The name of the dsn is what is used to look up the data at runtime so when it is published the SYSTEM_PUBLICATION_DIR has changed and Opus can not find the dsn data as the dsn name has altered. So when published if the publication ran from C:\Program Files\DBApp\ the dsn it would try to look up in Opus would have been "FILEDSN=C:\Program Files\DBApp\mm_Script.dsn" and Opus would not have any information so could not use the database.

Tony


For this message Tony Coleman has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 30th, 2004, 11:10 pm 
Offline

Joined: November 25th, 2004, 4:04 pm
Posts: 6
Location: Canada
So simple when you know the answer! Your explanations are very clear.

You saved a hundred hours of work! I was convinced that I bought the right product when I acquired OpusPro!

Thank you very much for your help!

Claude Dionne


For this message Claude Dionne has been thanked by : mackavi


Top
 Profile Visit website  
 
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 38 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