NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Niels Larsen on October 17, 2008, 02:03:11 AM

Title: Best way to make a webserver use multiple datasets
Post by: Niels Larsen on October 17, 2008, 02:03:11 AM
Hi

I would like to make my server handle severel datasets, depending on who has loged in.
Any ideas??

Best regards
Niels Larsen
Title: Re: Best way to make a webserver use multiple datasets
Post by: Graham on October 17, 2008, 04:07:20 AM
Hi Niels,

In one of our web apps, we use tps files with a variable for the file name specified in dictionary.

At login,  we assign the users folder and filename to this variable.

All session file operations for this user act on the his dataset

Regards
Graham
Title: Re: Best way to make a webserver use multiple datasets
Post by: Bruce on October 17, 2008, 07:49:21 AM
Hi Niels,

Graham is right.
a) in the dict set the full path name for the file to be a variable
b) In the ProcessLink method, before parent call, set the variable based on a session value.

Cheers
Bruce
Title: Re: Best way to make a webserver use multiple datasets
Post by: Niels Larsen on October 18, 2008, 01:22:45 AM
Sounds easy - I'll try
Thanks!!
Title: Re: Best way to make a webserver use multiple datasets
Post by: Niels Larsen on October 18, 2008, 09:47:01 AM
Hi
I have tryed all example web apps, but can't find the right example. Can one of you help me??

/Niels
Title: Re: Best way to make a webserver use multiple datasets
Post by: Bruce on October 18, 2008, 09:08:37 PM
Hi Niels,

I don't think any of the examples does this, as far as I can recall.

However it's only 2 steps, so if you get stuck just ask.

cheers
Bruce
Title: Re: Best way to make a webserver use multiple datasets
Post by: Mr Larsen on October 21, 2008, 12:07:25 AM
Hi
Next time I also need to understand what you write  ;)
I just works great....
Thansk!
/Niels
Title: Re: Best way to make a webserver use multiple datasets
Post by: charl99 on October 21, 2008, 05:55:33 AM
For those interested, we run the web app at different clients on SQL Server.  The database names are obviously different at every client, so to connect to the right SQL database we simply use the .ini file (I guess TPS file can also be used) and put the following code in the WebServer proc under Window Manager -> Init -> Restore from INI file.

 GLOD:Server      =   GETINI('connection','server','','.\grailweb.ini')    !'grailserver'
 GLOD:Database    =   GETINI('connection','database','','.\grailweb.ini')    !'grail_HIU'
 GLOD:dbUser      =   'USER'
 GLOD:dbPass      =   'PASSWORD'
 GLOD:SQL_Connect =   GLOD:Server &','& GLOD:Database &','& GLOD:dbUser &','&GLOD:dbPass

where the INI file looks something like this:

[WebServer]
Maximize=No
Minimize=No
XPos=419
YPos=221
[__Dont_Touch_Me__]
Sectors=0
[connection]
server=grailserver
database=grail_grail
docsign=last
PH=No
Broker=Yes
User=Yes
Claims=Yes

Maybe somebody will find this useful.

Cheers

Charl