Re: Firewall settings choices
From: Denny (mrdenny@gamespy.com)
Date: 02/05/03
- Next message: Denny: "Re: new userID can do all..."
- Previous message: Roger Wolter[MSFT]: "Re: Invalid authorization specification"
- In reply to: Fox Bortniker: "Re: Firewall settings choices"
- Next in thread: Fox Bortniker: "Re: Firewall settings choices"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Denny" <mrdenny@gamespy.com> Date: Wed, 5 Feb 2003 13:25:10 -0800
No problem. There are two schools of thought when it comes to web access to
databases. Once group uses DSN, one uses connection strings. I like
connection strings because if you need to move the web site to another web
server, or you have to restore the site from tape you don't have to worry
about recreating the DSN. Everything is already there.
Here's how I do it.
I create a file to be included in /core on the web site call SQLConn.inc or
something like that. In that file I put a single line, which places my
connection string in an ASP varable.
<%SQLConn = "DRIVER={SQL
Server};SERVER={ServerName};DATABASE={DataBaseName};UID={UserName};PWD={Logi
nAccountPassword};"%>
Now on every page that needs database access I put
<!--#include virtual="/core/SQLConn.inc"-->
Now to access the database I use the following.
<%sqlx = "select * from table1"
set adox = CreateObject("ADODB.RecordSet")
adox.Open sqlx, SQLConn, 3, 3%>
Other ADO Code goes here
<%adox.close
set adox = nothing%>
Be sure that you have the set adox = nothing, otherwise you could end up
with unclosed database connections.
And yes the SQL code from Access and SQL Server is mostly the same. There's
a couple of differances, but nothing major that you'll notice while making a
web site.
If you have any other questions, just let me know.
-- Denny Cherry Database Administrator GameSpy Industries "Fox Bortniker" <fox@connexions.net> wrote in message news:eoYofuVzCHA.2816@TK2MSFTNGP09... > > > Thanks so much. I followed what you said and feel a bit > better now. Unfortunately I really know nothing about this server. I > only installed it for sake of a set of tmeplates that require SQL Server > for them to run. Installing them, they do all the work. They create the > databases and all. They use PHP, which I do not know, so I can't really > figure much out from looking at them. This leads me to a very basic > question, if you don't mind another. > > I am building a little web site ap to track the members and points for > my kids Martial Arts tournament circuit. I am using an ACCESS 2000 > database and am not yet done. In thinking about it, I realized I was > better off with one of the tables being broken down into a more linear > scheme. This will cause that table to end up with 20 - 30 thousand > records. When I realized I had SQL Server sitting here and that I was no > longer intimidated (since my books tell me that moslty the same code can > be used for both) , I decided to see how this works. I imported the > Database and tables and wanted to see if I could run it as is. I created > a SYSTEM-DSN but I cannot log into the DSN via the webpage. Can you tell > me how I set this up ? I am expecting that I need something set up in > the SQL Manager for web access by IUSR or whatever needs be. > > Thanks again, > Fox > > *** Sent via Developersdex http://www.developersdex.com *** > Don't just participate in USENET...get rewarded for it!
- Next message: Denny: "Re: new userID can do all..."
- Previous message: Roger Wolter[MSFT]: "Re: Invalid authorization specification"
- In reply to: Fox Bortniker: "Re: Firewall settings choices"
- Next in thread: Fox Bortniker: "Re: Firewall settings choices"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|