NetTalk Central

Author Topic: Best way to make a webserver use multiple datasets  (Read 6287 times)

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Best way to make a webserver use multiple datasets
« 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

Graham

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Best way to make a webserver use multiple datasets
« Reply #1 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Best way to make a webserver use multiple datasets
« Reply #2 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

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Best way to make a webserver use multiple datasets
« Reply #3 on: October 18, 2008, 01:22:45 AM »
Sounds easy - I'll try
Thanks!!

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Best way to make a webserver use multiple datasets
« Reply #4 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Best way to make a webserver use multiple datasets
« Reply #5 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

Mr Larsen

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Best way to make a webserver use multiple datasets
« Reply #6 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

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Best way to make a webserver use multiple datasets
« Reply #7 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