Concern about putting connection strings in an Include file (.inc)


recently in an effort to start cleaning up my scripting (I'm pretty sloppy) and to reduce redundancy, I began putting database connection strings in an include file for all of my ASP.

I've been doing this for a while now, but then it occurred to me the other day that anyone could view the source code of my page, add the .inc file onto the end of the web address in their browser and then view the connection string right there in their browser!

Does anyone else do this What are the potential problems Is it a problem Any input would be great!
Posted On: Monday 22nd of October 2012 01:11:59 AM Total Views:  331
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




2-part question about checkbox repeated regions

A TWO-PART QUESTION...PART 1: I have a page with repeat region checkboxes on it (using Ultradev) and these checkboxes are populated by a database field like so...http://216.122.245.51/friends/RAB/select.aspHere's the problem: Notice how there are excess identical "industries" listed The region is repeating according to how many like records there are in each industry. I don't want this. How do I solve this problem If there is an industry, say "Roofing Contractor," how do I get the page to only list ONE checkbox for ONE industry instead of THREE checkboxes just because there are three "like-industried" contractors in the database I hope this question makes sense. In a nutshell: I want one checkbox per industry even though there are multiple records within that industry.PART 2: Try out the form by selecting only one checkbox and click on "Submit." It works, right OK go back and try again, but this time select multiple industries and click "Submit." You'll see that the industry= values get passed but my verify.asp page won't display multiple industries in the same table. How do I remedy thisAnyone's quick reply is very much appreciated! Deadline looms.
VIEWS ON THIS POST

273

Posted on:

Monday 22nd October 2012
View Replies!

another question about Session

,I have a session, when it times-out, I want to go to another page automaticly (is automaticly correct spelled :) )So I watch to my screen, do nothing and when the session times-out I want to redirect to another page without doing anything ... is this possiblegreetzThe one and only ASP-sucker
VIEWS ON THIS POST

188

Posted on:

Monday 22nd October 2012
View Replies!

Need to get information about the Webserver Via Scripts

I am writing a Dianostic web application for another web app we have, so far I was able to create some what of a filemanager, that'll show the Version informations for ActiveX files, and other types, now I Want to be able to present information about the webserver.1) Determine Properties that are set2) Determine state of web services3) Determine version of WebServer(ie: NT sp, IIS version, etc)by being able to show information webserver, ODBC setups, and controls, we can help our client without spending half a day on the phone with them asking them to check the version of this and that. any help is appreciated thanks also anyone know how to get ODBC information, like the DSN on the machine, if this can be done in VB ActiveX Dll, I can do that too Karlkb244@kb244.8m.com Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
VIEWS ON THIS POST

226

Posted on:

Tuesday 23rd October 2012
View Replies!

Question about Application Variables

all, Let's say we have a bunch of websites, owned by different people. The sites are all different, but the common theme is they are car enthusiast websites. Each of these websites has their own unique index page (of course), but also "common" pages, which are pages shared by all the websites. One of the common pages, checks for the value of an application variable, which may or may not exist. For example, lets call this page luxurycars.asp, which is a simple page that shows the top 10 luxury cars of this year. This common luxury car page will pull and use the app variable like so: Code: Dim SiteOwner SiteOwner = Application("OwnerName") Response.Write("This site is managed by " & SiteOwner) This app variable is set uniquely in each clients index.asp page like so: Code: Application("OwnerName") = "John Doe" Will this work I just started learning classic ASP (for my job), and I'm reading that application variables are universal and only one copy of the variable will exist. So does this mean if John Doe sets Application("OwnerName") to "John Doe" in HIS index.asp page, will that visits the common luxury car page see John Doe's name Regardless of whether they got to that page via John Doe's page or someone elses And if so would using a Session variable instead solve this problem Sorry if this sounds confusing, let me know if I need to re-word it or give more detail...
VIEWS ON THIS POST

140

Posted on:

Thursday 25th October 2012
View Replies!

Question about tracking

my question is about tracking the previous page. there is a form(ex=subscribe.asp) which is an asp page where users can sign up for newsletters. this asp file calls a php file in the form action which i have written and this php file processes information user entered and inserts to the database. this works fine. in the website there are numerous pages from which a user can click on an image and be redirected to subscribe.asp and fill in the form. I need to know which page the user was before subscribe.asp ex = aboutus.asp, contactus.asp etc. is there a way i can pass information from this subscribe.asp file to the php file which the php file can read and find out the source of the previous page (ex= aboutus.asp, contactus.asp etc) please advice.
VIEWS ON THIS POST

291

Posted on:

Friday 26th October 2012
View Replies!

Question about uploading tables

My Boss has asked me to find a way to take access tables and upload them to SQL Server via a web interface created by me. Is that possible Does anyone have any leads Thank You!
VIEWS ON THIS POST

660

Posted on:

Friday 26th October 2012
View Replies!

Quick question about access data type with asp

When you display information from a the database, and the database type for it is Yes or No. It displays as True or False in asp when writing it back. Is it possible to get it to say Yes or No instead of True or False without adding a ton of new variables or some hacky workaround
VIEWS ON THIS POST

319

Posted on:

Friday 26th October 2012
View Replies!

Complete newbie question about connection

I have to admit that I have always been a php developer and have very limited exposure to asp. I can typically read the code and figure out what is going on, but wouldn't know where to begin writing me own at this point; which is where my problem comes up. I am trying to re-write a tool (that is in asp) in php (long story as to why). The asp software is talking to a Pervasive.SQL (v8) database, but I can't figure out how. The only connection lines that exist in the file are: set my_conn= Server.CreateObject("ADODB.Connection") my_Conn.Open Application("FOS_ConnectionString") Now I did some searching online and I thought that maybe the FOS_ConnectionString would point to a UDL file that contained the location of the database, username, password, etc... But I can't find any udl files. Am I way off-base here Anybody care to tell me exactly how the above code is opening a database connection... My guess is that the first line tells it what type of connection to use (ADOdb), then the next line tells it to open the database connection, but I need to know how to find the database location, username, password, etc.. strictly from this code (the past developer is no longer involved).
VIEWS ON THIS POST

394

Posted on:

Friday 26th October 2012
View Replies!

Question about fs.FileExists and Servers 2000 or 2003

I have a number of sites and because I have so many images, I use the same image folder on one of my sites for ALL the sites. First of all, is doing this "breaking" any rules or creating any problems that may not be obvious Second, I've recently added a new domain and the host put the new site on a different server than the others. The older sites are on a windows 2000 server while the new site is on a windows 2003 server. Now back to the image thing. In order to do the File check on the images, I need all of them to be on the same server. The host can move the sites and I'm considering moving the new site back with the others to the windows 2000 server. Good idea Bad idea Recommendations
VIEWS ON THIS POST

124

Posted on:

Friday 26th October 2012
View Replies!

Question about updating SQL

I am having trouble updating more than one column in my sql database. I have tried everything I can think of and I am pretty sure it is something simple that I am just missing. I would appreciate any help that can be given. This is from the Update page. Code: This is from the request form page. Code:   It gets the Date part right everytime, but if a box is checked it takes the information from every Latitude textbox and passes it to the SQL Server for that one checkbox. I am getting a type mismatch error. It never gets to the Longitude or QtyItems but I commented out the SQL Update portion and add response.write to see what it was doing and it shows that it will do the same for the other two fields also. I only want it to pick the textbox that goes with the checkbox. Is it because the name of the textbox is the same for every item I tried naming it dynamically like name="Latitude_ but I could not get it to update at all then. Again, any help would be appreciated.
VIEWS ON THIS POST

322

Posted on:

Friday 26th October 2012
View Replies!

Quick question about Instr

Why does this code Code: Dim mytext mytext = "Tristique, sed tamen typicus amet, bene quia feugait eu. " Response.Write Instr(mytext, "tamen") Gives the response "16" Surely this word only appears once Is it counting letters How can I make it identify just words
VIEWS ON THIS POST

149

Posted on:

Friday 26th October 2012
View Replies!

Question about showing an include file

I would like to have the option to show and include file which has a one line table with a red background and printing to pull info out of a SQL database but only if there is data in the table. Basically it is to show breaking news when it happens before there is an article. The SQL table is called breakingnews and the column is called brknews. If the column brknews has nothing in it, I don't want the table to show up on the page but if there is data in it, I want the colored table and text to show up on the page.
VIEWS ON THIS POST

240

Posted on:

Friday 26th October 2012
View Replies!

A question about SQL and posibly ... normalization!

Here is my problem; I have a database that goes something like this: 1st column - 2nd column Red ------- I class Blue -------II class Green ------II class Yellow -----III class Black ----- IV class Orange --- II class I want to query this with SQL to a html table that will make this to appear as: I class - II class - III class - IV class Red ---- Blue -----Yellow ---- Black -------- Green -------------------- -------- Orange ------------------ Do I have to normalize that one table in several others, or there is another way of doing this. I am confused about that normalization process as well. Please help.
VIEWS ON THIS POST

304

Posted on:

Friday 26th October 2012
View Replies!

The Best sites for learning about how to build different ASP applications.

What are the best sites that discuss building shopping cart apps , bulletin boards or other typical ASP applications I need to read more before I start my own.
VIEWS ON THIS POST

230

Posted on:

Friday 26th October 2012
View Replies!

about connecting to SQL server with OLE-DB

I have a ASP question about connecting to SQL server with OLE-DB There are three way(is there any more) to connect to SQL server below, Is it right I don't know why so many ways I don't know what's mean. --------------------------------------------------------------------- Set adoconn=Server.CreateObject("ADODB.Connection") strConn="Provider=SQLOLEDB;Data Source=SQL server's address;" & _ "DataBase=database's name;UID=username;PWD=password" adoconn.Open strConn ----------------------------------------------------------------- Set adoconn=Server.CreateObject("ADODB.Connection") strConn="Provider=SQLOLEDB;Server=SQL server's address;" & _ "DataBase=database's name;UID=username;PWD=password" adoconn.Open strConn ----------------------------------------------------------------- Set adoconn=Server.CreateObject("ADODB.Connection")str Conn="Provider=sqloledb;" & "Data Source=myServerName;" & _ "Initial Catalog=myDatabaseName;" & "User Id=myUsername;" & _ "Password=myPassword" adoconn.Open strConn -------------------------------------------------------------------
VIEWS ON THIS POST

279

Posted on:

Friday 26th October 2012
View Replies!

Question about Database Connection Resources

As i use ADODB in my asp pages to connect to access databases i always wonder what memory/size issues i should consider. eg i have 3 connections to a database on one page. This worries me that i might be overdoing it. would it be noticably slower than having one does the server struggle to carry this sort of thing out How could i look to speed up the processing of my asp. I guess my question is are there any articles out there relating to performance of asp code and/or ADODB/OLEDB connections
VIEWS ON THIS POST

128

Posted on:

Friday 26th October 2012
View Replies!

Question about printing report

I would like to have a function for user to print the order confirmation page. I need to have the company logo, column header, date, order no. on every page. Can I make the report to split into pages automatically Can I use CSS to do that Or can I use other way to do that without using Crystal Report Any example I can refer to
VIEWS ON THIS POST

281

Posted on:

Friday 26th October 2012
View Replies!