 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 30th, 2004, 08:51 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
How to handl multipul database from different locs
Hi,
I am using free web hosting for a test web site ... so i divide databse into some of databases (according to space) on different sites ... one database handle users login and other things and other all provide data for asp pages ..now one thing how i can update dbs from my pc VB application ..and second how to prevent access from other site pages .... i mean how to pass and check securities, user info as well allowed actions...
there are 3 databases on three different locations ....
one hold users info as well paswords...
and other 2 provide required information against user logins ...
how to hanld and access ...
thanks
Stay Beautiful,
Abdul Salam
__________________
Stay Beautiful,
Abdul Salam
|
|

June 30th, 2004, 09:13 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I think it is difficult to update remote database through a VB application on your machine without blocking the site for some time.(unless you have some synchronization tools that work over web). The possibility for this also depends on the type of database you use. If you are using file databases like MS Access, you may download access database, put it in your machine. Then connect to VB and do manipulation. Then upload it back.
What I normally do to update database is to develop an admin area whose pages are accessible only to logged in users. In one of the database, you can define a table which contains details of users who can access admin pages (just a username and password enough). In the admin area, there will be a login page. After successful login, you may store the logged-in status to session(session("logged_in_status")=true).
Then you can design pages in admin which can update data. On the top of each such page, you check the value of session("logged_in_status"). If it is not set or different from true, redirect to login page.
There is only one drawback for this. Session need to be enabled on the browser which does admin side works.
Best wishes,
Madhu
|
|

June 30th, 2004, 09:19 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
And if your problem is to connect to 3 databases which are in 3 different locations, the obvious solution is to have 3 connection object. One each to connect to one database.
You may not need 3 connection objects on all pages. Please put them depending on your requirement to connect to various databases in the page.
|
|

June 30th, 2004, 09:52 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Right madhu .....
Actually i have three login space on geocities for testing this web ....
i'm trying to connect my vb application with db1 but still trying .... (Ms Access)
yes making a copy or admin area is nice idea but how i will switch one site to an other site...
and varify user name which is stored on first location .... i mean how to pass site user name and password to access database on 2nd location .... as well user login and password too..
Stay Beautiful,
Abdul Salam
|
|

June 30th, 2004, 11:16 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
HI Abdul,
well i think MADHU's suggestion about the ADMIN area is best .. i have using it consistently and its working wonderfully for me ... as for passing values to other sites ...
(1) if the amount of data to be passes is not large and also no. of users of the website is not large then use SESSION variables for storing them .. but this is not considered to be a good design practice .. since increasing the no. session variables affect performance ..
(2) Another choice is attach the data in QUERYSTRINGS which works great ... but if this data contains sensitive information then i would suggest that you write your own ENCRYPTING & DECRYPTING FUNCTIONS andsend this in encryptedformat ...
of course before writing your own encrypt and decript functions it would be better if you check existence of an inbuilt method which does it for ..
Since i have never sent encrypted data through a querystring i dont know about it .. whether such a method exists or not ...
Try this .. hope it works ...
Sudhan.
|
|

June 30th, 2004, 11:45 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Abdul,
This was discussed in another topic here. You can take a look at it.
Single login for different domains
But be sure that you have access from all the 3 websites to the same database where the user/password info are stored. Else you cannot prevent/allow/check users from one site to roam around the other. Not only that, you also have to then synchronise the user/password related data across all the three databases that you use.
Quote:
|
quote:how i can update dbs from my pc VB application
|
Why don't you use ASP instead of VB to access that database, is there any specific reason for not using ASP for that. Else as Madhu said, you got to manually synchronise data with the one on one of those free hosting servers by download--manipulate--upload.
Hi Madhu,
Quote:
|
quote:Session need to be enabled on the browser which does admin side works.
|
How does one enable session on the browser?
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|

July 1st, 2004, 12:02 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Sudhan,
Quote:
|
quote:Another choice is attach the data in QUERYSTRINGS which works great ... but if this data contains sensitive information then i would suggest that you write your own ENCRYPTING & DECRYPTING FUNCTIONS andsend this in encryptedformat ...
|
I won't say this method could be a safer one.
For instance, it is possible for one who does not own the account still manages to copy the encrypted query string of other user and uses that with the same URL, and try to play around with someone's account. May be this is kind of rare imagination one can get, but still it is usafe, than passing it by POST method, as discussed in the other thread, I posted earlier.
What say?;)
_________________________
- Vijay G
Strive for Perfection
|
|

July 1st, 2004, 12:21 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Dear Vijay,
The method to block session in IE6.0 is
Go tools>Internet options>Privacy(tab)
Advanced - > block cookies and uncheck "Always allow per session cookies"
But for some reason, this does not work in my machine.
But in older versions of IE, you have an option in advanced tab which says disable per-session cookies. This will surely block session.
|
|

July 1st, 2004, 12:42 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Madhu,
I assume that it enables the COOKIES at the client side, not the SESSION which are SERVER SIDE variables, and AFAIK they cannot be manipulated from the client's browser settings.
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|

July 1st, 2004, 12:56 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Vijay,
But when I do the above steps, my session controlled sites stop work in my browser.
This was indicated to me by one of our client and most of the corporate companies do this in all their browsers to protect any leakage of their privacy.
|
|
 |