Re: Firewall settings choices

From: Denny (mrdenny@gamespy.com)
Date: 02/05/03


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!


Relevant Pages

  • Re: SQL Express 2005 doesnt support multiple users....
    ... > database should specify the same connection. ... With user instances, you are ... > Express) and set both client connection strings to ... > Jasper Smith (SQL Server MVP) ...
    (microsoft.public.sqlserver.connect)
  • RE: How do I enable the web server to create a database?
    ... Although I have still had no success creating the database, ... I tried some new connection strings in web.config. ... also be caused by the role manager feature not being enabled. ... tried using SQL Server Authentication is a member of every role in the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Connections String Questions
    ... As far as Q1 - always use SqlClient with a SQL Server or SQL Express ... Help on connection strings to see what best suits your application. ... Which provider should be preferred when defining a connection, ... I have a database on my local PC and the same ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SQL Express 2005 doesnt support multiple users....
    ... > database should specify the same connection. ... With user instances, you are ... > Express) and set both client connection strings to ... > Jasper Smith (SQL Server MVP) ...
    (microsoft.public.sqlserver.connect)
  • Re: .Net Provider for DB2 in HIS 2006
    ... I wrote the following little Console program to get the iSeries DB2 Schema ... // Connect to the database then retrieve the schema information. ... I pasted the Connection strings from the working code to the Analysis ...
    (microsoft.public.sqlserver.olap)