.mdb Temp File (ldb) Not Destroyed After Closing Database Conn
I recently installed IIS lockdown, and ever since my ASP pages have been hell. One problem is that now after a user views my ASP page which reads my local Access DB, the temporary file, .ldb, stays in the folder forever!
This temp file is created when a user opens the file, so I checked out the .ldb file and it says the ADMINISTRATOR is opening the file! How can the internet user be using the ADMIN account?! This is not good news! I will share my code for my page; however I have a feeling the code isn't the problem, but a setting is. Code:
View Replies
ADVERTISEMENT
I am trying to setup an ASP code to write a text file to the client side, not the server side, for the purpose where it will be email attachment.
The following code seems to only work on the server side and was wondering if there as an equivalent out there for the client side since I am trying to avoid potential interruptions on the server side:
Const TemporaryFolder = 2
Dim myFSO, WriteStuff, myAttachment, tfolder
Set myFSO = CreateObject("Scripting.FileSystemObject")
Set tfolder = myFSO.GetSpecialFolder(TemporaryFolder)
if (right(tfolder,1) <> "") then
tfolder = tfolder & ""
end if
myAttachment = tfolder & "test.txt"
Set WriteStuff = myFSO.CreateTextFile(myAttachment, True)
View Replies
View Related
I am trying to write a sub that will delete a spreadsheet file created by the web user. THis is the code I have inserted into the global.asa file, but it is not working.
sub Session_OnEnd
'delete the temporary excel spreadsheet
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(Server.mappath("temp/<%=session.sessionid%>.xls"))
Set objFSO = Nothing
end sub
I have made sure that the temp folder has permissions set for the IUSR_machinename account to be able to delete files. I am running IIS 5 on a windows 2000 server.
View Replies
View Related
I created connection to the Microsoft Access DB using DSN from my ASP page.
<%
Set vpconn = Server.CreateObject("ADODB.Connection")
vpconn.ConnectionString =
"File Name=c:inetpubwwwrootDBDNAME.dsn"
vpconn.Open
' Close connection immediately after opening for testing
vpconn.Close
Set vpconn=Nothing
%>
The Microsoft Access, for every database opened for shared use, creates an .ldb file to prevent users from writing data to pages that other users have locked. Whenever the last user closes a shared database, the .ldb file should be deleted.
It is working; the .ldb file is deleted immediately after closing connection
but not if you open/close this connection from your ASP page.
What I found, the .ldb file is deleted with about 70 seconds delays after closing connection from an ASP page.
View Replies
View Related
I need to be able to view a list of files (could be large number!) on a web page and hv been considering using the filesystemobject just to create an array. However their maybe a large number of files and they may need to be sorted.
View Replies
View Related
Anyone has done declaring temp table in ASP code, and then populate the temp table, and then inner join with other table and so on? I encounter some sql error it seems indicate asp can't do such operations..
View Replies
View Related
I have data that needs to write to a temp table (there is a lot of data sometimes). Once they are finished, the user approves their input and it goes to a permanent table.
I give them the option of deleting that data by cancelling their request.
The problem I have, just to be on the safe side, what can I do to protect myself if the user closes or perhaps browses away from the page? Is there any sort of an window command whereby I could enable a sort of a kill-like function?
View Replies
View Related
I have a dropdown that calls a javascript function onChange. One of the lines in the script is:
tmp = document.form1.familyID.options[document.form1.familyID.selectedIndex].value;
How do I change it to allow familyID to be a variable passed to the function?
View Replies
View Related
I want to do the following but am not able to do it.I have one query which is:
SQL2 = "SELECT * From totalcloser INNER JOIN zipcode ON totalcloser.zip = zipcode.zip order by totalcloser.zip"
I want to store result of this query in a temp table so that now i can go ahead and compare the results in the temp table with some other table.I know i can do this in Access..but i want to do this by coding (in my program itself) where the query runs and dumps the query results in temp table and then the second query runs and does comparisons and displays the result on screen.Towards the end ,we can flush the contents of the temp table.
View Replies
View Related
I have a some code:
Rs.Open "[TableName]", Conn, 1,3,2
RS.AddNew
RS.Fields("Account_Name").Value = request.Form("Account_Name")
my question is does conn, 1,3,2 only write to the database not making the data readable? if i change it to conn, 0,1 i get page can't be displayed. I'm using access DB, with conn 1,3,2 it inserts fine, but when i go to query it i get no records found, but i see the data in the database, anybody have any ideas?
View Replies
View Related
I want to retrieve row from a stored procedure that uses temp table.
Stored procedure works well in SQL Query Analyzer, but if run it from ASP thru Command object, i am getting an error stating that,
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
code used: .....
View Replies
View Related
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open application("dtat_motor_connectionstring")
set rs = new adodb.recordset
'Set RS = Conn.Execute(' "exec spcn_update_transactions &
customer_number, customer_name, customer_address, customer_city,
customer_state, customer_zip, customer_phone, vin,
acct_number, tag, title_number, tag_type_number, branch_number,
institution_number, yr_make, state_from, type_number)
response.write rs
%>
I'm I connecting them correctly. Is there and easier way to execute a stored procedure. I'm trying to insert data into a SQL page. I have to have the customer number returned to me asap for the next page.
View Replies
View Related
I use this code all the time, but what does the ",,129" mean? Are there other parameters that one might use (I only do fairly simple SQL commands).
conn.execute strSQL,,129
View Replies
View Related
Is there any way to modify the locktype when updating a database via a connection object's execute method? I have a game which worked completely fine when only ten or so people were playing, but as it grew into the hundreds, many people started getting errors and I'm 99% sure that they occur when the database tries to update when it's locked, which means that my connection execute statements are defaulting to pessimistic locking, which I don't want them to. Does anyone know how I can fix this?
View Replies
View Related
what is the best way to protect the connection strings keeping an effective, low overheaded access to them ?
View Replies
View Related
I have a problem utilising my connection string to open more than one recordset in one ASP page.
The following code runs absolutley fine on a server running ASP 3, but falls over when run on a server running ASP 2 (the error says:
Microsoft JET Database Engine error '80004005'
Could not use ''; file already in use.
The code I am trying to run is: Code:
View Replies
View Related
I searched the forum but I am still a little confused regarding the global.asa file. I created a global.asa file and it is in the root of the virdual directory. I then created a sub to initially connect to a datase such as: Code:
View Replies
View Related
I have 3 db connections, 2 of which are dsnless connections to access db's. Any of my previous existing pages that have recordsets from these db's work fine. I can add a new recordset to them and it works fine as well.
If I create a new page and add the same recordset in the same directory, I get the error msg saying something like "unable to open registry key" which from my understanding, means the page cant find the db.
Now I am using Dreamweaver 2004, and using their way to create connections where it creates a file, and then just adds an include statement an asp page if you use that connection.
Any good way to test this connection on the page or any ideas on how to troubleshoot where the path its pointing to is incorrect...im pretty much stuck at this point.
View Replies
View Related
What is the best way to control is a transaction? I've done a little test and both of the examples below seem to do the job, but I was wondering which is the better method, this:
If err.number <> 0 Then
conn.RollbackTrans
Else
conn.CommitTrans
End If
Or this:
If conn.Errors.Count <> 0 Then
conn.RollbackTrans
Else
conn.CommitTrans
End If
View Replies
View Related
I'm trying to access an access database by including the DB's password within the connection string. I try to connect to the DB, but I get and "Incorrect Password" error. What am I doing wrong?
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"; uid=admin; pwd="pass"
conn.Open(Server.Mappath("maindb.mdb"))
set rsUpdateEntry = Server.CreateObject("ADODB.recordset")
View Replies
View Related
I am currently working on a small asp application. Now I would like to store the complete database connection in the application object. Note I want to store the connection NOT the connectionstring. For that purpose I wrote a small asp include which connects to the dbase and stores the connection object to the application object. However when I use this include in my pages then it doesnt work. What I am doing wrong? Here is the code:
View Replies
View Related
today i got an error from my site
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_DBC failed
it got error when i tried to update.then i checked all my files which has database stuff.i did not see any close statement for recordset & connection.we used DSN for connection.this site was build my someother firm.when i asked to my boss he told me they kept connection open purposely becoz they had uesd connection pooling.they said using connection pooling can utilize less memory resource.should i close each & every open recordset & connection
View Replies
View Related
I realize that sometimes you can use recordsets that were never opened (like when you're adding a record to a db) and I realize that you cannot close a recordset such as this.
But for the ones that ARE open, should they be closed first and then set to nothing?
Also,I'm trying to create code that checks if a recordset is open. If so, I wnat to close it. How would I do that?
View Replies
View Related
In my code I am opening a new window through javascript which opens upon submitting a form. The form collects certain information from user ; and this information is used to create a file.This file is created after the page is submitted and just after the file is created I want to destroy the window and then give a link on the page to download the file.
Is there any way to do this. The problem I faced was upon submitting the page I loose the window object that is returned by window.open method.
View Replies
View Related
for readability purposes,I plan to standardize all my asp pages to always open connection at the beginning of the page and close the connection at the end of the page
If in the middle of the page I issued redirection,does this mean the connection will not be closed?
View Replies
View Related
I have a page on a server (not under my control) that can't have scheduled tasks running on it and I need to hit the page once a day. I am currently doing this through a .bat file on our server which runs iexplore.exe and hits the page. Is there anyway I can get this window to close? either though the .asp page or in the .bat file.
This is becoming more of a problem as there is the likelyhood that within a month or so, I may have more pages requiring this same operation and it isn't very good to have to log on to the server each morning just to close these windows.
View Replies
View Related
I have in the back of my mind and knowing the importance of using close(rsname) to close a recordset once it has been finished with, is whether any recordsets have been left open accidentally.
Is there, therefore, a way of listing all open recordsets, without specifiying the name of the recordset? ie. "For each key in recordset". Do recordsets get closed after a period of non-use?
View Replies
View Related
I just want to close my dsn connection. I cannot seem to find it. is it Set conn = Nothing?
View Replies
View Related
Is there anyway to close a browser without getting the "Do you want to close this window" pop up? I intend to launch a browser using the windows scheduler. And auto close it itself. I tried using self.close() ...but got that pop up confirmation. Anyway?
View Replies
View Related
What's the proper syntax for determining if a connection is open before closing it?
View Replies
View Related
I have a button that goes to a new page - if a person clicks on the X in the right hand corner - I want it to go back to the previous page. How do I set this - I can't set the target to blank.
View Replies
View Related
My website has been targetted by a web scam. They have sent out an email, which looks as if it's come from me (the email tells them that they must update their information). There is a link in the email which, when clicked, opens up 2 windows: my site in the background and a small window on top with form. This forms asks the customer to submit sensitive information. Is there any script I can use to close down other windows when my site is opened? I can't think of any other quick solution at the moment.
View Replies
View Related
how to close an asp application. What is the ASP code i should use to close the browser Is it something like "window.close".
View Replies
View Related