Storing Connect Strings And Other Variable?
I want to store connect Strings in one global place. Which is the best practice to store such values and other constants.
View RepliesI want to store connect Strings in one global place. Which is the best practice to store such values and other constants.
View RepliesI tried the search function but I can't really identify what this kind of issue would be called (Searching store variable comes back with hundreds/thousands of hits).
I am doing an update form which opens 2 SQL connections (its easier for me to do this cause I mess up joins to a significant degree, that and performance is not a big worry, eitherway).
<notes> Both connections are open, one is called rs, the other is called articlers. I have 2 databases (named database1, and database2), and I have two different SQL strings (SQL and articleSQL, the problem comes in the 2nd string and in storing a variable. Code:
What I have is an ASP page that starts off with multiple ways to access a project list and other pages via mysql queries. One of those is a button with the following
<form name="ProjectsActive" method="post" action="P_ProjSort.asp?ActiveSort=1&MySort=1">
From this button I'm wanting to pass a variable to acknowledge that it is ONLY wanting ACTIVE projects and also what was originally already there which is the MySort for sorting by different columns. The next page has the following I cut out some irrelevant stuff. Code:
I was looking for a method to store the contents of text file within a variable. So far I am able to read the text file and output the results using the write method. Going a step further I also wanted to replace a particular string within those same results using the "Replace" function. This works as well.
My question, how can I store the final result that write's to the screen so that I can reference it later. If you run this code, I basically want to take the verbiage that displays on the sreen and place it into a variable. Code:
I'm using a session variable to store a log in so the user only has to log in once every time they come to the site for multiple features that require a password check.
What I'm doing is using one central login page that pops up when they click on whatever locked feature they're going for. The password form's action is back to this same page, which has this code towards the top: Code:
if there is a quick way of converting a string into an actual variable.The reason I ask this is to save me having to type each variable name out when trying to request the values from a form.
View Replies View RelatedThe example I am working from uses the following code which does not work:
RDS.Connect = "Provider='sqloledb';Integrated Security='SSPI';Initial
So I tried the following, but still no go. Code:
The example I am working from uses the following code which does not work:
RDS.Connect = "Provider='sqloledb';Integrated Security='SSPI';Initial
Code:
I am using a customized version of the XML RSS Content Feed VBScript Class (available at:
XML RSS Content Feed VBScript Class to show an XML-feed on my web site. Since the web site are based on a CMS that uses an MS SQL - database, I will try to store the XML-feed in the database instead of just displaying it using a XML/RSS-parser.
I know Microsoft have several tools for this, but they seems to sofisticated and complicated for my use. I just wants an simple ASP-script that reads thought the XML-feed, and store the differnt news-items straight into my MS-SQL DB.
Anyone know of any special issues with storing cookies with ASP? I'm
trying this with two browsers: One is IE 6.0 with cookies set to
'prompt'. This has been working properly as any new site I goto seems
to prompt me to store their cookie. The other is Pocket IE on Pocket
PC 2002, with the cookies set to 'enabled'.
My problem is that the cookies dont seem to be being written with my
ASP. I dont get the prompt to store the cookie when I should. My
storage code looks like this:
Response.Cookies("AcctNbr")= nAcctNbr
Response.Cookies("MsgStart")= nMsgStart
Response.Cookies("MsgEnd")= nMsgEnd
Response.Cookies("AcctNbr").Expires= DateAdd("h", 15, Now)
Response.Cookies("MsgStart").Expires= DateAdd("h", 15, Now)
Response.Cookies("MsgEnd").Expires= DateAdd("h", 15, Now)
And the read code looks like this:
I have run into a unique issue, what I want to be able to do is store a collection or array into a database or xml file. The main reason for doing this, is I don't want to use Sessions as they are volatile to server hiccups or resets. I don't want to use cookies as they are insecure, but I will use one cookie to store a UniqueID to relate to the data in the database or XML file.Can anyone think of a way to store an array in Access, MySQL, or XML file?
View Replies View RelatedI'm writing a vbscript application that reads UTF-8 XML containing Chinese
characters and stores the data in MySql 4.0.x.
Does anybody have any experience in this area with regarding codepage and
character sets? Ideally I want the scripts to be able to handle Standard
European characters and Chinese characters as well.
Are there any special considerations for using MySql/ODBC and ADO to get and
put the data.
I've read that you shouldn't store objects in Session variables.
I've read these reasons:
- The object takes up memory that may not be freed until the session times
out. Better to create the object only when you actually use it.
- Causes poor performance because the thread that created the object has to
service all requests for it.
Assuming I can live with the memory and performance implications (a big if,
but let's assume it for a minute), what other reasons are there?
I have a page which reads the contents from a certain table. The displayed text is followed by a link which is also stored in that table. They can just click the link belonging to a certain newsitem and the page with that news will display. But, for every new item I make a new page. What I want is that the link every time opens the same newspage but with only the selected newsitem. Something like "SELECT description FROM tblNews Where ID= [the ID belonging to the link I pressed on the previous page]"
View Replies View RelatedIs anyone know how I can store Word Docs and PDF's in database, and how I can make link for visitor to download these files.
View Replies View RelatedWhen I'm creating database driven asp applications, I store my constants,including my connection string to the database within an asp file calledconstants.asp. All constants are stored inside asp coding <% ... %> so people can't save the data through the web.
I've been told this is an insecure way of storing the connect string becuase my connect string would also store the username and password to connect to the db.what is the current standard for storing an connect string to a database for asp applications?
developing a small application, user logs into a page, as soon as user logs into the page, the time(incl seconds) of the page opens has to store in database(time-in), and also the page closing time has to store in db (time-out).
once the time-in and time-out time is stored and it has to calculate the how much time user spend and the total time has to store in db?. i am using sql.
I'm trying to store a filename to in a variable from aspfreeupload file. Once the file is uploaded I can't seem to fine the variable it's stored in so that I can store it in the database without typing the filename in manually.
View Replies View Relatedhow to store information after the ? in the url in form fields. i.e. http://url/test.asp?User=Rob in Form Field UserName .
View Replies View RelatedCode:
<%
Dim rsDB
Dim strSQL
Dim name
Dim price
Set rsDB = Server.CreateObject("ADODB.Recordset" )
strSQL = "SELECT ProductName, ProductPrice FROM Products WHERE ProductID=" & Request("ProductID" )
rsDB.Open strSQL, Application("strConn" )
' put fields into variables
name=rsDB("ProductName" )
price=rsDB("ProductPrice" )
%>
I am trying to store some data from my database (access) into some variables so that I don't have to keep on opening up the database everytime I want to display the data. Dont know what I am doing wrong but i keep getting an internal server error 500.
I am not too familiar with arrays or recordsets, but I am trying to store ids from database records into an array in an ASP file.
I opened the recordset object in the ASP file, and the stored procedure in the SQL Server pulls back ids from multiple records. I want to store these ids in an array. But I am not sure how to do it. The recordset now seems to be only giving me one id (the id of the last record only) when the stored procedure is made to give ids from multiple records.
In a string what is the character I should use to represent an enter?
View Replies View Relatedi am retrieving a record from the database, I am trying to place the value of the FULLNAME field in a textbox on a Form, the Problem is that it only displays half of the name leaving out the stuff that comes after a SPACE.
Example:
adors("fullname").value <--- Actual Value is John Smith
but it only displays John
Code:
<INPUT id=text1 readonly name=txtfullname value=<%=adors("fullname").value%>>
but if I try to just response.write it anywhere on the page then it displays the entire name.
I am new to web design and ASP, I am developing a site which has a logon script, what I want to do is return a user to the location they were at after login. Some of the pages will have query-string information in the address bar so need capture that as well.
<script language="JavaScript">
x = window.location.href
document.cookie=x
</script>
Appears to do what I want as I can pick up the href out of the cookie after login and return user to page, prob is I don't seem to be able to include it in my server side scripting which is doing the login it falls over at the script tag.....
I have a wast databse of records, where there are so many Images assiociated with each record. I store the Image paths, record's primary key in the database and retrive them as and when required to display the records and the necessary images corresponding to the records. the image path as of now contains a relative path from the root directoy.
Problem:
The main problem is ..what happenes when the hard disk is full and if i add another harddisk.. and add images into that new hard disk. how will i be able to address the images?? as they are in a separate hard disk hence cannot be addressed relative to the web site's root directory..
How to secure images,Docs from anonymous preying Eyes?
I am trying to store currency symbols in my ms-sql database using an ASP script. But it just wouldnt save them or even submit the form. Has anyone done this before?
View Replies View RelatedIs it possible for me to store an image gif,jpg in an access table and retrieve it in my ASP page. if yes how do i do that?
View Replies View RelatedI'm developing an intranet and I would like for first time visitors (per session) to check a table's settings so that the intranet would act accordingly.
in tblIntranetSettings, I have a field called fldIntranetDown. This field holds a 0 or 1 value (0 meaning the Intranet is not down and 1 meaning that it is)
I would like for the supposed system to check this value and perform a function dependant on the value it finds. My thoughts were to use the Session_OnStart of the global.asa, but to my understanding that is only fired off as a new session is created (yes, this checks the value, but read on for a possible snafu)
Now, if I had a visitor who did this check, and it came up as 0, allowing them to peruse the intranet, and something came up where I changed that value to 1, thus closing the intranet, said user could still roam, as that the check SHOULDN'T be made on a per page request basis (that would be a hog, wouldn't it?)
So my question is, "How can I develop some kind of system where the database values are stored for all to reference without multiple hits on the DB and only updated (to be checked) when their values are changed?"
Please don't feel like you have to give the EXACT answer here. If you say something like "You'll need to look into XXX, that do what you want", then that is all I need (I like doing the research, I'm just stumped for an answer to HOW I can go about doing this)
I'm using ASP/VBScript on a WindowsXP/2K network with Access2K2/SQL2K DBs.
I want to store information within 1 field. For example
my field is:
Region1:
[Name]David[/NAME][UNITS]26[/UNITS]
IF I wanted to without changing the entire string could I change the value of 26? Like remove [UNITS][/UNITS]
and add my new number?
I would like to ask how I would go about storing large amounts of text in a database for example products reviews or descriptions?
I am using MS Access Database and the text field in the table only allows a max 255 field size.
I would then like to display the text in a HTML page.
What is the best way to store the items and quantities that customers have chosen across a session without using cookies The customer does not need to login to do online shopping and users will be prompted to enter shipping information when they proceed to checkout.
View Replies View RelatedI am using ASP as front End and My SQL as back end. I have a text box which inputs the comments but my sql gives error while inserting that text into field(I have tried this with both VARCHAR and LONGTEXT).
these characters are not very special like ' ( ) it is not storing these also any body have any idea what should i do to resolve this issue.
I am trying to store the currency symbol used for a trasaction in a database field but rather than store £ it stores £ (see the wierd character at the beginning of the symbol) instead.
The strange thing in even after storing this when I display the currency on one page it shoes it as £ but on two of the pages it still shows £ I have looked at the database the value stored is £ where as the user is only entering £ .