Source language: Translate to:

About dbp Alias

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

About dbp Alias

Postby carlos torres » Wed Mar 18, 2009 3:07 pm

Hi everybody

TIA

Is there any way to assign a dynamic alias to a database working with dbp plugin?

The question is because I have big database w/ questions for quizzes. The app work in a LAN network. When the student log in, the app open database with alias "ABC" it works OK, BUT when a second student log open database with the same the alias the first student become locked.

Is there any way to avoid this?

regards
carlost
User avatar
carlos torres
 
Posts: 289
Joined: Mon May 02, 2005 8:14 am
Location: Pamplona, Colombia

Postby Neosoft Support » Wed Mar 18, 2009 4:28 pm

By alias, I assume you're talking about the Database ID. The ID is unique to DBPro and used internally to identify the database object on the local PC. It doesn't have any effect on how the database engine itself works or how data is accessed on the server.

Can you be more spefic about what you're running into? Are you receiving an error message from the database engine indicating the the file is locked? What type of database are you using (Access, mySQL, etc.)?
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

About dbp Alias

Postby carlos torres » Fri Mar 20, 2009 11:47 am

Dear NBTeam

I'm using ms-access database.

My next steps are:
-select certain number of questions form the original table (Quiz)
- create new tables using the student code one for each student, keeping the original table without modifications
- Assign each student table field to the fileds on my nb page
- At the end, save the content of each student table as an RTF file
- dropout the created student table

Hopefully it will work on a LAN 'cause I was using the same table name to operate on a LAN enviroment. Probably, that was the cause to each new student who access the quiz block the last one.

thanks to help me rethink the situation

regards
carlost
User avatar
carlos torres
 
Posts: 289
Joined: Mon May 02, 2005 8:14 am
Location: Pamplona, Colombia

About Working on LAN enviroment

Postby carlos torres » Sat Mar 28, 2009 8:22 am

Dear NB Team

TIA

This week I was testing again my quiz app on a LAN environment. For a single user it works OK. When a second student access to answer his test the app shows a warning messages that says something like
To many things has changed

It stuck again. The app block the first user and assume that the active one is the last connected one.

The basic code that i'm using is
Code: Select all
   ...// COPY Questions en NUeva Db
        ...///original database w/ questions
        dbpOpenAccessDatabase "Quiz" "[PubDir]\Data\Quiz.mdb" "123"
        dbpOpenTable "Quiz" "[tbName]" ""
        ...///select questions by unit
        dbpQuery "Quiz" "[tbName]" "Unit=[#34][nUnit][#34]"
        .../// create student table
         dbpCreateTable "Quiz" "[txtCode]" "ID AutoInc;Question Memo"
         dbpOpenTable "Quiz" "[txtCode]" ""

        .../// fill in the student table w/ n questions
        .../// each record match the Array[i] number
        Loop "1" "10" "[i]"
             dbpAddRecord "Quiz" "[txtCode]"
             dbpGotoRecord "Quiz" "[tbName]" "[Array[i]]"
             SetVar "[Quiz.[txtCode].Question]" "[Quiz.[tbName].Question]"
        EndLoop
       ...///close all
       dbpCloseTable "Quiz" "[tbName]"
       dbpCloseTable "Quiz" "[txtCode]"
       
       ....//// then GOTO test page
                 dbpOpenTable "Quiz" "[txtCode]" "OpenTbl"
   

The routine OpenTbl just refresh the fields shown on the screen. This is the code
Code: Select all
       .../// Routine OpenTbl
   SetVar "[PosQ]""![Quiz.[txtCode].$RecNum] of [Quiz.txtCode].$RecCount]"
          .../// refresh the fields on the screen
                  SetVar "[Quiz.Question]" "[Quiz.[txtCode].Question]"
      ...///   endsub


The application runs perfect for a single user but when i try to share/use it in a LAN environment it fails.
My questions are:
- If each student is accessing to his own table why the app stuck?
- What I'm missing or doing wrong?

I will appreciate your help

regards,
carlost
User avatar
carlos torres
 
Posts: 289
Joined: Mon May 02, 2005 8:14 am
Location: Pamplona, Colombia

Postby Gaev » Sat Mar 28, 2009 9:31 am

Carlos:

I don't have access to a LAN environment ... so I can not check it out ... but some things to consider ...

1) Confirm that each user has a different [txtCode] value ... perhaps your Application can display it to users

2) See if there is any difference when ...

- you dbpCloseDatabase after the first step (copying Questions to the newly created [txtCode] Table) ... and re-open it for the second step

- in step 2, temporarily remove the reference to the (on record change) Subroutine

3) If all else fails, you can consider one/more of these alternate designs ...

a) instead of creating [txtCode] Tables as/when needed, try and batch create them from a single (Admin User) computer ... then the Quiz Taker program will just have to open the [txtCode] Table for each student ... i.e. no access to common [tbName] Table

b) in step 2, copy all the questions to an Array Variable ... and dbpCloseDatabase ... then re-open it if/when needed later ... so the possibility of concurrent access is greatly reduced

c) instead of a separate [txtCode] Table for each student, create a separate [txtCode] mdb for each student.


BTW, which exact command are you trying to invoke when the error message is displayed ?
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Working on a LAN environment

Postby ChuffaW » Sun Mar 29, 2009 7:33 pm

Hi Carlos,
We use a access-based database over LAN and get similar locking issues.
We find that if one specific PC opens the database first then all is well.
If other PC's open the program first then some, if not all, PC's are locked out.
It appears to be the 'dbpOpenAccessDatabase' rather than the loading of tables that causes issues for us.

I would guess it is an Access issue / Windows issue.
For us, we just make sure that one specific PC is the first to connect.
An alternative design proposed by Gaev might be the way to go though.

Also, if you use Access to open the database directly... then use the nb program so that dbpro opens and closes the database, before using multiple connections.
I have found using Access directly causes locking problems too and this seems to fix it.

Best of luck.
Chuffa
ChuffaW
 
Posts: 4
Joined: Tue Dec 09, 2008 4:26 pm
Location: Western Australia

About using LAN

Postby carlos torres » Mon Mar 30, 2009 10:38 am

Dear ChuffaW and Gaev

thanks for your suggestions, I will try some of them.
regards,
carlosT
User avatar
carlos torres
 
Posts: 289
Joined: Mon May 02, 2005 8:14 am
Location: Pamplona, Colombia

Postby Neosoft Support » Mon Mar 30, 2009 10:48 am

You might also try using a server-side cursor. This may help in a multi-user environment. From the DBPro help file:

By default NeoBookDBPro uses something called a client-side cursor. Simply put, this is a method of accessing data that relies on the client application to handle most of the data storage and processing. Client-side processing is very flexible and generally provides the fastest performance for small to medium sized databases. For large databases, however, a client-side cursor can sometimes consume too many system resources resulting in poor performance. To compensate for this problem, you may want to use a server-side cursor when working with very large databases. In NeoBookDBPro you can switch to a server-side cursor by adding "CursorLocation=Server" to your connection string. For example:

dbpOpenDatabase "MyDB" "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=[PubDir]AddressBook.mdb;CursorLocation=Server"

With a client-side cursor (the default) all data is copied to the local machine and processed there. This provides access to features not normally supported by servers such as sorting and indexing. When using a SQL query, only the data returned is copied to the local machine. A server-side cursor doesn't provide as much flexibility, but is often more appropriate for large databases, and may be required when the size of a database exceeds the available memory and disk space available on a local machine.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests

cron