Query Db Using Session Object Or Text File
Need to query an access db usign the contents of a text file that has one entry in it, and id ie: drsmith
Here's what I have thus far (the db call is in an include file)
<%
Dim fso, read
set fso = createobject("scripting.filesystemobject")
set read = fso.opentextfile(server.mappath("settings.inc"))
SQL = "SELECT * FROM news WHERE Company_id = (??????)"
Set rs = Server.CreateObject("ADODB.RecordSet")
Set RS = Conn.Execute(SQL)
%>
View Replies
ADVERTISEMENT
Have no problem getting my select queries to work using this method:
strSQL = "SELECT tblUI.IPAdd FROM tblUI WHERE (tblUI.IPAdd =?)"
arSPrm = Array(strRemHst)
Set rst = cmd.Execute(,arSPrm)
Can anyone point me to some examples of using this method for UPDATE and
INSERT queries? Can't seem to get it to work no matter what I can think of
to try. (If it is possible?)
View Replies
View Related
i built an adminisrator page that needs to be under SSL,when its under SSL i cant use the Session object so i cant really know if he is an administrator.
i can make a unique password to the page but the problem is its a page that reloaded often to show different things & then each time he will need to enter the password, a little bit annowing.
View Replies
View Related
I have a page with about 90 input fields all on one page, I would like to split it up into about 5 pages, with each one a next button.
I would like to know, must I put each value into a hidden field to reference on the last page, or should I use session objects?
Can I use a session like this?
session("property").Bathrooms = 2
View Replies
View Related
I am working on a web store that has been having some problem with memory leakage; so I am working thought my code and I am just following up on an issue I have discovered I don’t know the answer to. I am self taught so if my question looks stupid please bear with me.
Set objMyObject = Server.CreateObject(Name)
Do I need to use the objMyObject.Close? before the Set objMyObject = Nothing is called? Could someone please explain or expand as to when and why I use the .Close call.
View Replies
View Related
I created a class ImageEdit to help me get more from an image component i'm using. The class has few private properties and public methods. One of the methods is the Load() method which requires 1 parameter: the complete path to the image.
As long as i have the class definition included in the page and create and instance of the class on a page and use the properties and methods, everything is fine. The problem arises when i try to set this instance in a session variable like so:
set session("imageedit") = new ImageEdit
And this also seems to work fine as long as i'm still executing the code on the same page the new object has been created on. However... i can not get this object to work on any other page. Weather i use this: Code:
View Replies
View Related
This is a strange thing. My Session object is expiring when the page is refreshed.This is happening in just one partiular page. Rest of the pages are working fine
View Replies
View Related
I have a class declared as this:
Class CShoppingCart
dim sTableName
Public Property Let TableName (sNewTableName)
if sNewTableName <> "" Then
sTableName = sNewTableName
end if
End Property
Public Property Get TableName ()
TableName = sTableName
End property
.....
Then in a login page i do this
Set Session("cart") = New CShoppingCart
so now, the cart is a session object that can be called from every page in this session BUT.... when i do this in a different page:
Response.Write Session("cart").TableName
I get an asp error (Erreur d'exécution Microsoft VBScript (0x800A01B6) )saying this is not a supported method (the error is actually in french! i can paste it if u want)
The object seems to be valid (IsNull return false and IsObject returns true) but i cannot invoke its methods and read its properties ....
View Replies
View Related
I would like to be able to get the type of object that a session variable contains (for example, determine whether it is a string, integer, single precision floating point, ADODB.Recordset, etc...)
I need to know this for a ASP <----> ASP.NET session management script I am writing. I would like to be able just to copy strings and numbers. I already have code that does this, but I don't want my script to blow up when it finds a recordset in the session object.Is there any easy way to detect the object type in ASP?
View Replies
View Related
I have a session object Session("login") whereas I need to extend the time on this to 1 hour, instead of the default 20 minutes. After initializing Session("login"), how would I change the timeout value?
View Replies
View Related
I have code that loops through a directory reading files..
now the problem is that files are constantly being uploaded and I only want the file system object to read those that are finished being uploaded.
How can I check the properties of the file to see if it's in middle of being written before i read the file?
View Replies
View Related
i made database with these fields :
id ,name , address ,favo ,email , phone
now i did every thing ok i can add data readdata search by on of any field.
but i do not know how can i search with 3 fields .
i mean i need page include 3 input text one for name
2nd for email , and 3rd for phone . also botton for search
but i want when the user do not input any name or email and click on search botton popup messege come tell you must input all fileds then back to search page . if he input all and click search i want new page read data from database.
View Replies
View Related
I have a page with a drop down box and a text field. The drop down box selects a column from a table in my database. txtField is the drop down box and txtSearch is the text field.
The form method is post and the results are passed to the next page which has the query for the database as shown below. Anyone any ideas why I get no results from the query? It works in queryanalyzer so I assume its my asp thats wrong? Code:
View Replies
View Related
Here's a question that I've not been able to get a definitive answer to.
Creating an STA object (such as a typical VB6 object) and assigning to the
ASP Session store is a bad thing.
It's a bad thing because it forces IIS to affiliate the Session with the
Thread on which the STA object is created.
This means all subsequent requests for that session can only be handled by
that worker thread and can therefore result it in poor performance as
requests queue up to access the thread they are affiliated with.
My question(s) is/are this:
Is this affilation now set in stone for the life time of the session?
Does removing the STA object from the session remove the affiliation or is
IIS/ASP just not that clever?
View Replies
View Related
I'm wondering where the data is stored for Session objects. Is it passed to the browser, and then passed back to the server during page requests? Or, is the Session data always on the server, and the browser simply passes the server it's unique session id?
View Replies
View Related
I have a SQL DB with a number of tables and queries (views) in.
In front of this is my ASP app I am designing.
When my users log in, their User ID is stored in a session variable.
One of the views determines which User ID can access which records, and
obviously then I want to base all my app around this so that a user can only
ever be working on data relevant to them.
Is there any way of using a variable in my SQL View outside of DWMX so that
once my users log in, the SQL View is automatically filtered based on their
User ID in the session variable?
Is there a way of inserting a variable/parameter into SQL so this happens?
View Replies
View Related
I am trying to alter a text string to create a valid boolean query for
an index server search.
At the moment because the text string is created using combo boxes it
can have 2 or more 'AND's in succession.
Like This (strInput):
"Company AND Credit AND AND London AND AND Richmond Short Term AND AND
Intercompany AND Investment Bank AND Covertible AND AND "
what I want to do is change the above string to (strOutput2):
"Company AND Credit AND London AND Richmond AND Short Term AND
Intercompany AND Investment Bank AND Covertible"
I am trying to do it with the code below:
However this code produces problems as I loop through the various
search items.
It works fine in VB but fails when I try to port it to ASP. Code:
View Replies
View Related
How can I give a user-defined object session scope? From
http://www.microsoft.com/windows200...asp/iiwaobu.htm
I gather that it can be done, but there are no examples. Simply setting
Set Session("tag") = new MyClass
doesn't work.
View Replies
View Related
I'm completely lost as to what's causing this error on my browser. When i try to view my site with Internet Explorer my asp pages show nothing but the below error:
Session object error 'ASP 0102 : 80004005'
The problem is we are still getting orders and the tech support from our hosting company says he's not getting the error so it seems i'm the only one getting it, to make it stranger if i look at my site using Mozilla Firefox i don't get any error. This seems to conflict with the fact that asp is a server side script and so the browser shouldn't make any difference to asp errors but in my case it does?
What's stranger still is if i try to log into my sites Helm control panel i get a similar asp error but this time no matter what browser i use i get the same error and can't log in.
If anyone has any idea what could be causing this or more importantly what i can do to fix it I'd be very grateful to hear about it. I hadn't changed anything on my site or my browser when this error started appearing about 2 days ago and the tech support say if they aren't getting the error their end they can't fix it so I've no idea what to do.
View Replies
View Related
I am using the File System Object to create server side cookies and part of
the Function that I am writing deletes a file but I am getting a permissions
denied error on that line of code.
I am using Integrated security only on this site but how do I get the
IUSER_Machinename account to work with Integrated Security?
View Replies
View Related
I'm getting an error when I'm retreaving from a "text field" in the database and it has no data in it. I'm using MYSQL version 3.23.58-nt. I have the same script running a different system and I don't get this error. It justs output nothing and continues with the loop.
This has to be an ASP problem when retrieving data from the database. I've change the Field for Message to "varchar(252)" vice "text" in the database and stoped giving me error. But I still need to use the type "text" in the database since my "Message" will be longer then 252 caracter. Code:
View Replies
View Related
i'm converting an image file to hexa..then the hexa is saved to a text file..
can any one help me how to read the content text of a text file?...
im doing it this way because i don't want to save hexa in my database, because it makes the database slower to open up.
View Replies
View Related
Does anyone know of a method of converting text files to sound files (.wav, mp3 etc) which can be accessed from ASP?
I have an ASP-based website that enables users to design choreography for equestrian dressage. The resulting design is held as a series of coded movements in a database and it can then be reproduced as text or as a series of diagrams. I would like to offer the option of an audio version.
View Replies
View Related
Im trying to do something very simple with the file object. I try to access it but when I open the page through the browser my server doesnt seem to respond...it just wont load the page, much like what happens in an infinite loop, the status bar slowly moving up forever. I would be very grateful for ANY suggestions you may have to the problem. Ive attached my code below,
SET objFSO = Server.CreateObject("Scripting.FileSystemObject" )
SET objFile = objFSO.GetFile(Server.MapPath("log.txt" ))
Response.Write("log.txt was last modified " & objFile.DateLastModified)
SET objFile = NOTHING
SET objFSO = NOTHING ...
View Replies
View Related
I am trying to create a text file by using the following code. But it's not working. It just loading the page that's all.
<%
DIM fso, NewsFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set NewsFile = fso.CreateTextFile("c: est1.txt", True)
NewsFile.WriteLine("Hello World!")
NewsFile.Close
%>
View Replies
View Related
How the heck would I go about saving an object to file? Put would be perfect, and can basically save everything except objects - how do I save an object if I can't use put?
View Replies
View Related
I have a server which has 100 template websites on it, each with unique domains. This may grow upwards to 500 websites. As I have been publishing websites to the server now and then I come across a bug in some code OR wish to enhance an aspect of the site. With the exception of a file or two, every site on the server has the same folder hierarchy.
Example, every site has a directory called toolbox. If I make a change in one file located in a particular site, can I write a script that some how woud copy that file and iterate through ALL sites inserting that file as necessary. I don't expect someone to show me how to do this, but rather tell me if it is a logical approach to managing such a large number of sites.
View Replies
View Related
I am trying to create a text file by using the following code. But it's not working. It just loading the page that's all.
<%
DIM fso, NewsFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set NewsFile = fso.CreateTextFile("c: est1.txt", True)
NewsFile.WriteLine("Hello World!")
NewsFile.Close
%>
View Replies
View Related
Is there any command in FSO syntax to delete a record (delete a line) in a textfile database? Example:
WriteRecord.DeleteLine(Record)
View Replies
View Related
I have used File System object to write contents in a text file. But when i request the page, it just processing without completing the job.. The writing to text file is not happening.
View Replies
View Related
what im trying to do is write out certain files that our in a current folder. For example I have a folder called images and i have about 20 sub folders inside of the images folder. What i want to do is search the Images folder including all the subfolders and write the name and path of where ever the image was found inside of the images folder.
View Replies
View Related
I have about 200 documents to which I need to write a header and a footer. Appending (the footer) is easy, but I cannot figure out how to write to the very beginning of the file.
View Replies
View Related
when we use File system object in asp to read disk content of a server, in which sort order file system object reads and put all files in a list. well I put images in a folder and FSO reads and display on web page, I want to sort these images, for example by name or by date of creation.
How can I do that,If I have to do something with fso or, I can sepratly sort the listitem where fso stores the list.
View Replies
View Related