ASP and Permissions

 
Post new topic   Reply to topic    Aprelium Forum Index -> Classic ASP
View previous topic :: View next topic  
Author Message
Thissa
-


Joined: 14 Jun 2003
Posts: 7

PostPosted: Sun Jun 29, 2003 10:58 pm    Post subject: ASP and Permissions Reply with quote

I have an ASP script that reads information from and writes information to a database. When I access it from my computer (the one running AHTML and Abyss), the script works flawlessly. However when my friends try to access it from their computers, they are all unable to write to the database. How do I give everyone write access permissions to my database? I am running Windows XP.
Back to top View user's profile Send private message
mcwilliams132
-


Joined: 27 Jul 2003
Posts: 167
Location: Oshkosh, WI

PostPosted: Wed Sep 24, 2003 4:54 pm    Post subject: Reply with quote

hmmm...that's weird.

What kind of database are you using? MS Access, MySQL?

Typically when connecting to a database you set some security on the database, like a username and password, and pass that information through the connection string...So when you access the page to read or write...the security passes automatically.

I'm guessing that you're using an Access DB and you only have rights from the local machine.

You'd have to set up an ODBC connection to the database, and connect through that in your script...Otherwise you're the only one that can connect to it from your machine.
_________________
::::::::::::::::::::::::::::::::::::::::::::::::::
:: Jon-Paul LeClair
:: http://mcwilliamsworld.com
:: "Lobster sticks to magnet!"
Back to top View user's profile Send private message Visit poster's website
Thissa
-


Joined: 14 Jun 2003
Posts: 7

PostPosted: Wed Sep 24, 2003 10:29 pm    Post subject: Reply with quote

You are correct, I am using a Microsoft Access database. I know very little ASP, as I have been learning it in my Infotech 12 class at high school. My database worked fine on the school server, accessable by everyone, however when I brought it home and ran it on Abyss, even after changing the paths and such, I could not get it to work properly as I was the only one who could use the database. As you may (or may not) have noticed, my original post was from June 29th, and what I ended up doing between then and now was signing up for a free account with http://www.brinkster.com and hosting the page + DB there, where again I had no problems.

So I suppose, the question now becomes how would I go about setting the correct access permissions, assuming I wished to do this again in the future? I'm not entirely sure what ODBC is, I as never taught it in school...if you could provide a link to a tutorial or example, it would be much appreciated :)

This is how I am connecting to my database:
(LD_path is a user-definable variable which points to the access DB file)
Code:
'***** connect to the database
set Connection = Server.CreateObject("ADODB.Connection")
Connection.Provider = "Microsoft.Jet.OLEDB.4.0"
Connection.Open LD_path


Here's a snippet of how I read information from the DB - the recordset names, table names, etc. vary from file to file (would I need to change any of this?)
Code:
'***** figure out if the user exists...
SQL = "SELECT UserName FROM LD_users WHERE UserName = '" & UserToView & "'"

'***** read the table
set rsUserCheck = Server.CreateObject("ADODB.recordset")
rsUserCheck.Open SQL, Connection


Thanks so much for getting back to me on this :)
Back to top View user's profile Send private message
mcwilliams132
-


Joined: 27 Jul 2003
Posts: 167
Location: Oshkosh, WI

PostPosted: Thu Sep 25, 2003 9:55 pm    Post subject: Reply with quote

Ahhh...very good...

here are some of my favorite ASP sites you may like:

htt://www.asp101.com

http://www.learnasp.com/learn/

http://www.asptutorial.info/

ASP101 is my favorite page...very easy and informative with good examples.

ODBC is OPEN DATABASE CONNECTIVITY.

It's a way of communicating to data sources.

You could set up a DSN (data source name) to connect to the database.

So you'd create a system DSN (which is just an alias to the database) in the ODBC manager, then access the database through the DSN like so:

Set myConn = Server.CreateObject("ADODB.Connection")
myConn.Open "DSN=myDSN;UID=somename;PWD=password"

"myDSN" being the name of the data source that connects to your database.

There are other ways, but you could connect to an Access DB like such without a DSN

myConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\database.mdb"

You can also include username and password, if needed, but that should get you into the database....

I hope that helps a bit...
_________________
::::::::::::::::::::::::::::::::::::::::::::::::::
:: Jon-Paul LeClair
:: http://mcwilliamsworld.com
:: "Lobster sticks to magnet!"
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Classic ASP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB phpBB Group