Monday, 26 May 2008
|
| Wrong answer Old Pedant 12:58:01 |
| | "Neil Gould" wrote:
Recently, .nLL <noone@here.com> posted: returns 5.99988000239995E-05 how can i convert it to a n.nn ? VBScript: <%=Round(2/3334, 2)%> No, that will actually display simply 0
That's because his number, rounded to 2 decimal places, is 0.00 (no non-zero digits). But *AS A NUMBER*, there is no difference between 0.00 and just plain 0.
So when you Response.Write zero, you get simply 0 Nothing more.
You *MUST* use FormatNumber( 2/33334, 2 ) or equivalent if you really want to see 0.00 displayed.
|
| | 2 answer | Add comment |
|
| Simpler way to do this! Old Pedant 08:32:00 |
| | <% ... Set conn = Server.CreateObject("ADODB.Connection") conn.Open "... your connection string ..."
SQL = "update test set testID = 1 where testID = 1" affected = -1 conn.Execute SQL, affected
Response.Write affected & " records updated" ... %>
You don't *have* to initialize the "affected" variable before doing the execute--just DIM'ing it will do the trick--but I like to do that as a sanity check. You can even initialize it to affected = "Something went wrong" if you want, since all VBS variables are Variants.
|
| | Add comment |
|
| good (x,y) graph plotting code for classic ASP? Mike 08:06:00 |
| | Hello,
I want to plot a bunch of curves on a graph. Each curve will be defined by 10-20 (x,y) points. The points can be connected by lines.
Preferably (though not necessary), I would like to be able to select the line or curve so I can identify it in a text box below the graph.
Does anyone have a recommendation for ASP code or a component to do this?
Thank you,
Mike
|
| | 2 answer | Add comment |
|
| DsGetDcName() failures Nick Burkitt 07:43:08 |
| | I have an application that uses DsGetDcName() to determine the sites (and domains) of servers in the network. I have found that DsGetDcName() fails rather often, and the reason(s) is not obvious. The typical error code is RPC_S_SERVER_UNAVAILABLE, although RPC_E_ACCESS_DENIED is popular, as well. Sometimes simply retrying the call will result in success, but more often it does not. What can cause DsGetDcName() to fail (excluding the obvious situation where the server is down or otherwise not accessible)? Thanks,
-Nick
|
| | 6 answers | Add comment |
Saturday, 24 May 2008
|
| implicit connections Guest 15:16:47 |
| | i am maintaining a system that was developed using dream weaver. a lot of the asp ado code looks like this:
set sp_yellow = Server.CreateObject("ADODB.Command") sp_yellow.ActiveConnection = MM_MHR_CONN_STR_STRING sp_yellow.CommandText = "Sp_HPMSQ007_GetSystemConstants" sp_yellow.CommandType = 4 sp_yellow.CommandTimeout = 0 sp_yellow.Prepared = true sp_yellow.Parameters.Append sp_yellow.CreateParameter("@RETURN_VALUE", 3, 4) sp_yellow.Parameters.Append sp_yellow.CreateParameter("@P_NAME_TXT", 129, 1, 17, "MLSTN_YELLOW_DAYS") set rst_yellow = sp_yellow.Execute
someone on another forum expressed that dreamweaver "tends to drive the programmer to creat implicit connections and their effect on performance".
could someone explain this to me? a provide some better code? (we no longer are required to use dream weaver to develop code for the app).
thanks in advance.
|
| | 5 answers | Add comment |
Friday, 23 May 2008
|
| value of session variable is not stored... Keyser Soze 18:23:42 |
| | this is unbeliveable... i'm trying to set a session var "x" from a local var "y"
... session("x")= y response.write( session("x") ) --> it outputs the content! response.end --> stop here ...
but, i have another page that tells the content of these session var... amazingly it reports the OLD value of the session var....
unfortunately i can't reproduce it with a simple code like this but i can't post all the code, includes, etc i put "response.end" for ensure the processing stop there i'm sure that there is no a double submit that could overvrite the value....
please, i am desperated... and angry any idea?
thanks KS
|
| | 4 answer | Add comment |
Thursday, 22 May 2008
|
| free well-documented CMS Whatchamakeofit 02:55:45 |
| | hello. is there a free, well-documented (e.g. large support base, FAQs, newsgroups, etc) CMS that supports ASP? i know there plenty of those out there that support PHP, but not ASP. do they even exist? thanks
|
| | 1 answer | Add comment |
|
| Need help you sql injection proof queries Adrienne Boswell 00:29:41 |
| | Using MS SQL server version 8 sp 3, and I need help with converting my dynamic queries into parameterized queries and/or injection proof stored procedures.
Here is an example of what I currently do: set rs = createobject("ADODB.Recordset") sql = "SELECT DISTINCT city.id AS cityid, city_name AS city, state_id AS st FROM city, zipcode wHERE zipcode.id IN ( SELECT id FROM zipcode WHERE zipcode = '91205') AND city.id = zipcode.city_id"
rs.open sql, oconn 'get records rsarr = rs.getrows rs.close set rs = nothing oconn.close set oconn = nothing
I really appreciate this as we have been hit with the recent asprox botnet injection.
-- Adrienne Boswell at work Please resond so others can share
|
| | 2 answer | Add comment |
Wednesday, 21 May 2008
|
| File upload/download Mangler 21:18:59 |
| | Does anyone know of anything that will allow uploads to a server then show the URL of the file so the user can send and email to someone so it can be downloaded? I looked at huge asp upload and couldnt tell if it would show the url to the user. It has an email option but i cannot see if it does what i want it to do and i dont see anywhere on the site to find out.
|
| | 2 answer | Add comment |
|
| How to pass special characters through query string ? Sobin Thomas 17:22:45 |
| | Hi All, I want to pass a string that contains many special characters \ . _ etc) to another page in my website through query string. In my project I have a Gridview control ,in which there is a hyperlink field.The Gridview 's datasource is set as a database table at runtime.The hyperlink filed's DataNavigateUrlFields is set to "RecordID" ,which is a field in my database table.The RecordID field contains many special characters.I want to pass the RecordID to PlayRecord.aspx page .I transfer the RecordID by setting Hyperlink field's Data NavigateUrlFormat string as PlayRecord.aspx?RecID={0}.The problem is that, hyperlinks are not working as RecordID contains special characters.(It works if RecordID is a normal string). Hope you 'll surely have a solution. Thanking you in advance for your reply. Best Regards
|
| | 5 answers | Add comment |
|
| Calling an executable through a COM+ component via an asp page Guest 17:12:06 |
| | Hi all. I am working on a legacy application written in Classic ASP with VB6 COM+ components running on Windows 2003 Adv Server (32bit). There is one page in the app that uses Secure FTP to send a file to another application server upon a certain type of data change.
The way it works: Anonymous user posts the form -> ASP code instantiates the COM+ component which is starting using a Domain User -> Calls a method that creates the comma delimited data file and then calls the SFTP method -
SFTPMethod( ) 1. Writes out a script file that connects to the SFTP server, puts the file in the proper location.
2. Writes a batch file that calls the Tectia SFTP client passing the script file name as an argument - then archives the file after the script is executed.
3. Catches the return code from the SFTP client and passes the value back to the classic ASP page -> in the event of any values besides zero (Success), we display the error code and message on the page.
The Domain User has permissions to log on as a batch job, and log on as a service in the Local Security Policy. I have proven the Domain User has proper permissions to everything because I can log in to the web server as the Domain User, execute the SFTP client's command line command passing the app-generated script, and the whole thing works properly.
Furthermore, when I leave the remote desktop session open for the domain user account and run it from the web page, everything works. However, once I log the Domain User out, the transfer fails with the error 'Failed to connect to server' returned by the sFTP client.
So I know that the COM+ method being run as the Domain User can generate the data file, generate the script, call the executable, run the executable, and return the error. The SFTP client just cannot establish a connection off of the server unless the domain user has an active windows session on the server. I know I'm missing something stupid.
We have this working on an old Windows 2000 machine with the exception that the COM object is being called by a local admin user. But I can't find where the configuration is different in neither the COM component or the user's permissions. I've tried using a local admin account on this Windows 2003 server with the same error.
Any help would be much appreciated.
Thanks
|
| | 1 answer | Add comment |
|
| Re: Figuring out who the user is Bob Barrows 14:44:00 |
| | Jon Mcleod wrote:
Hello.. I'm using windows integrated security, with the following web.config: <authentication mode="Windows"/> <identity impersonate="true" userName="netuser" password="p"/> There was no way for you to know it (except maybe by browsing through some of the previous questions in this newsgroup before posting yours - always a recommended practice) , but this is a classic (COM-based) asp newsgroup. ASP.Net bears very little resemblance to classic ASP so, while you may be lucky enough to find a dotnet-knowledgeable person here who can answer your question, you can eliminate the luck factor by posting your question to a group where those dotnet-knowledgeable people hang out. I suggest microsoft.public.dotnet.framework.aspnet or the forums at www.asp.net.
And I am trying to figure out who is the actual human user sitting at the keyboard. With WindowsIdentity, I can find out all there is to know about the "netuser" account, but I need to know the signin name of the user who is actually logged into the domain. Maybe from the IIS logs?
-- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
|
| | 1 answer | Add comment |
Tuesday, 20 May 2008
|
| ASP.NET Forms + Frames John 22:29:58 |
| | Not sure if this is the right group for this question, but here goes:
I have a page containing 2 frames.
In the top frame, I have an ASP.NET form and 2 combo boxes, selecting an item from the first combo causes a postback to the same page, where in the SelectedIndexChanged event I fill the second combo.
The Target property of the form is set to the bottom frame.
I have a submit button in the form, the PostBackUrl property of which is set to a different page that writes the output I want in the bottom frame.
Whenever I select an item in the first combo, I get a copy of the top frame's content appearing in the bottom frame (WITH the correctly populated 2nd combo). This is as I expect, as the form is posting back but the output target is the bottom frame.
Clicking the submit button does put the correct output in the bottom frame.
My question is, how can I update the combo box contents on the form via postback, and also redirect the submission output of the form to a different frame?
Do I need to have 2 forms?
Can the form for the submit button be nested within the server form, if so, how?
I'm sure there must be a simple solution to this!
Any help greatly appreciated.
|
| | 1 answer | Add comment |
|
| Multiple Statements executed in a single step Remy 21:28:41 |
| | I have been working since 10am this morning (now after 1am in UK) on this. I can't see what the problem is.
I have a classic ASP application with a development database in MS SQL Express (All SPs applied). I have one occassasion where I would like to run an SQL Update statement and a select statement to retreive the rows affected. Code (abstracted):
strSQL = "update test set testID = 1 where testID = 1; select @@rowcount as 'RowsAffected';
I am trying to retrieve the 'RowsAffected' into a recordset and have tried rs.open and conn.execute methods. Regardless of what I try (providers, cursors etc.,) the result is always the same, the first statement executes and the 2nd doesn't. If I invalidate the second statement (malformed SQL) the expected error is thrown so its being parsed. I have changed the second statement to a simple select and its still ignored.
I can't for the life of me see what the issue is, I'm sure I did this years ago. This is time critical for me and I would be overjoyed if someone could help.
Thanks in advance.
|
| | 5 answers | Add comment |
Monday, 19 May 2008
|
| Maximum length SQL ".. not in .." Evertjan. 23:15:52 |
| | SQL = "SELECT FROM tblX WHERE Z not in ('a11','b22','c33','d44')"
Is there a maximum length of this litteral array ('a11','b22','c33','d44') ?
Or of the SQL string as such?
I would like to test 3000 plus records of 10 chars each for the few odd ones out in one go.
I am using the Jet engine.
=============
btw, can I use a real vbs array this way?
Do I do this?
a = "('" & join(arr,"','") & "')" SQL = "SELECT FROM tblX WHERE Z not in " & a
or is there a better way?
-- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
|
| | 5 answers | Add comment |
Sunday, 18 May 2008
|
| Passing parameters from ASP to MS Access query Mah-Skeet 21:14:37 |
| | Hi All,
First let me apologize if this isn't the right forum. I couldn't find an exact fit, but I'm desperate so...if you know where this should go please let me know.
Ok, I have a query in Access that runs fine if you enter empty parameters, but when I run the query from ASP I'm not getting any results (like I do in Access). Can anyone offer any advice? The code I'm using comes from http://www.xefteri.com/articles/show.cfm?id=6
Many thanks in advance,
Mark
|
| | 3 answer | Add comment |
|
| Bulkmail question Neil Gould 07:09:35 |
| | I'm preparing an ASP script to send email to club members via the club's website. In getting familiar with CDOSYS, I noticed that the recommended method of sending the same content to multiple recipients is to loop through the list of recipients. I had intended to BCC the message. Is there some reason to prefer looping through recipients?
The next task is to distribute the club's newsletter via one of the above approaches. Does this make one approach more desirable, and if so, why?
Thanks,
Neil
|
| | 9 answers | Add comment |
|
| Response.Addheader Tony 01:13:33 |
| | I've searched the web & can't find an answer to this.
Is it possible to successfully use Response.AddHeader for a robots meta tag?
For example, I want to do
<% IF request("PageID") = 252 THEN Response.AddHeader "robots", "noindex" : %>
|
| | 8 answers | Add comment |
Saturday, 17 May 2008
|
| Read from client machine Titus 15:33:11 |
| | Hi all, To secure my web site i need to read client Machien's MAC Address with javascript,
Can any body help me?
|
| | 2 answer | Add comment |
Friday, 16 May 2008
|
| divisiorn problem .nLL 23:35:04 |
| | <%=2/33334%>
returns 5.99988000239995E-05
how can i convert it to a n.nn ?
|
| | 3 answer | Add comment |
|
| IF exist /w FSO EQNish 21:17:47 |
| | IS there a way I can do an If exist to determin if a graphic is displayed?
something like this;
<p align="center">
if file exist "fileone.jpg" <img border="0" src="fileone.jpg"> if File exist "filetwo.jpg" <img border="0" src="fileone.jpg"> </p>
What I am trying to do is post JPGs from a folder structure, the files may or maynot be there, but I don't want to have the blank picture reference to be displayed as if I where to just hard code the graphics in the Html!
|
| | 2 answer | Add comment |
|
| CDO.Message problems Andrew Wan 19:01:21 |
| | I use CDO.Message to send mail. The problem is, CDO.Message will send to any malformed address, (eg. smtp:email.address@domain.com) and no errors are thrown. That's ok.
Is there any way to receive bounced messages?
|
| | 1 answer | Add comment |
|
| Problem getting hacked with this new SQL injection Tool. Adword71 and direct84 Lance Wynn 18:27:37 |
| | One of my server has been compromised from this virus, and I can't seem to block it out! I have shut down the infected server, but I need to figure out how to check for this, and stop it.
The site is running iis5 on Windows2000, the backend DB is SQLServer 2000
Can anyone point me to some good resources for this? This is urgent!
Thanks alot Lance
-- Support Fairtax Legislation www.fairtax.org
"A government big enough to give you everything you want, is strong enough to take everything you have." -Thomas Jefferson
|
| | 17 answers | Add comment |
Thursday, 15 May 2008
|
| RE: Problem getting hacked with this new SQL injection Tool. Adword71 Plange 21:09:01 |
| | This happened to me too, and it's some new SQL injection -- see http://cyberinsecure.com/phishing-botnet-expands-by-sql-injecting-websites-found-in-google/
"Lance Wynn" wrote:
One of my server has been compromised from this virus, and I can't seem to block it out! I have shut down the infected server, but I need to figure out how to check for this, and stop it. The site is running iis5 on Windows2000, the backend DB is SQLServer 2000 Can anyone point me to some good resources for this? This is urgent! Thanks alot Lance -- Support Fairtax Legislation "A government big enough to give you everything you want, is strong enough to take everything you have." -Thomas Jefferson |
| | Add comment |
|
| ADO issue (new) Dannasoft 19:57:22 |
| | I have a strange problem. ASP pages that have worked for years are suddenly giving me errors. Here's the scenario.
Server: Win2k Server running IIS
Opening ADODB recordsets. First recordset on page opens fine, but after closing it I try to use the same recordset object to open a second recordset and I get the following errror.
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21) ODBC driver does not support the requested properties.
Usually this is from a bad sql string used to open a recordset but the string is good. It only happens when re-using an existing recordset object to open a second recordset after closing the first.
Anyone experience this lately? Could it be some update on the server causing it?
|
| | 6 answers | Add comment |
|