How do I add a photo to my comment or blog entry?
ASP web-programming
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programmingGo to page: « previous | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | next »

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:
Thursday, 29 May 2008
Re: ASP VBScript insert / Update and ё sign Anthony Jones 01:07:48
 "GTN170777" <GTN170777@discussi­ons.microsoft.com> wrote in message
news:B6124F2D-7963-­4889-AB77-41EBB62077­C3@microsoft.com...
Hi guys,
Your expertise would be so appreciated on this one, I'm using CS3 and MS
SQL
server,
There is a field where a user may need to enter the pound sign, for
instance
"ё24,000 per annum plus benefits" etc
The problem is that somewhere during the insert update it changes the ё
pound sign to either a #hash or it inserts the value without the ёpound
sign...
The page lauguage is -
<%@LANGUAGE="VBSCRI­PT" CODEPAGE="65001"%>
the details in the head section are
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<script type="text/javascri­pt" src="../Scripts/cur­rentdate.js"></scrip­t>
<head>
<meta http-equiv="Content­-Type" content="text/html;­ charset=iso-8859-1"­>
The SQL Collation is SQL_Latin1_General_­CP1_CI_AS
I'm kind of at a loss as to what the problem is with the ё pound sign??
Is there maybe a way or catching and changing the ё sign before insert or
update??
PLEASE -- PLEASE help

I take it this page contains a form. Does it post back to this same page or
does the form action point elsewhere.

The page seems confused as to its character encoding. The codepage says
65001 which is UTF-8 whereas you have a meta content-type specifying
ISO-8869-1.

You should ensure that both the Form page and the page pointed at by the
action attribute both use the same codepage and that the charset in the
content type header matches the codepage encoding.



--
Anthony Jones - MVP ASP/ASP.NET


Add comment
Need ASP code for email attachments... Neil Gould 00:02:49
 Hi all,

Thanks for the suggestions for our club's initial bulkmail sending
routines. I did read up on the use of ASP vs. a separate COM app such as
ASPEmail, and determined that for our club's purposes the ASP code that
loops through the data and sends individual messages vs. BCC performs
adequately for simple messaging.

The next phase is to email the club's newsletter, which is in PDF format,
and I've run into the problem that CDO errors out because it doesn't
recognize the format using the basic config settings. In sifting through
the MSDN's CDO content and other sources I found some references that
would permit attaching .txt and .gif files, but not for PDFs. Does anyone
here know of a concise and relatively complete reference to such things as
cdoConfig settings, or better, a solution to this specific problem?

TIA,

Neil


comment 10 answers | Add comment
Wednesday, 28 May 2008
download file Guest 16:46:01
 dear sir/madam
I have to write a code for download file in asp

Thanks in advance
comment 3 answer | Add comment
IIS 6 SQL Injection Sanitation ISAPI Wildcard Rodney Viana 15:10:03
 IIS 6 SQL Injection Sanitation ISAPI Wildcard at
http://www.codeplex­.com/IIS6SQLInjectio­n

I created an ISAPI dll application to prevent SQL Injection attempts by
intercepting the HTTP requests and sanitizing both GET and POST variables (or
any combination of both) before the request reaches the intended code. This
is especially useful for legacy applications not designed to deal with MS SQL
Server Injection attempts. Though this application was designed with MS SQL
Server in mind, it can be used with no or minimal changes with other database
engines.

This ISAPI is only compatible with Internet Information Server (IIS) 6.0
which comes with Windows 2003. Windows XP uses IIS 5 engine which DOES NOT
support ISAPI Wildcard.

Cheers,
--
Rodney Viana, PMP
MCSE+I MCDBA MCST MOSS, SQL
comment 3 answer | Add comment
Tuesday, 27 May 2008
After Parenthesis in ASP Variables - Query Ll 23:13:48
 Hi,
I'm wondering about variable declaration in ASP - is there a good
resource for this? In naming variables, is there a way to include
characters in a variable name after the parenthesis/variabl­e in a
loop? I have quite a few variables (e.g. strOut1_a, strOut2_a, etc)
and thought a loop would be the best way to do this, but I am getting
errors for the characters after the parenthesis. My code is below.
Thanks for any help or resources.
Louis

-------------------­--------------------­--
for a=1 to 3
strOut(a)_a=objComm­("Out"&a&"_a")
response.write("Out­"&a&"_a")
next
comment 3 answer | Add comment
Securing ASP app with session Drew 22:04:37
 I have been working on internal, intranet apps in the past few years, so I
haven't needed to secure apps with a login/password and sessions like I did
8 or so years ago (I use Windows Auth now, which makes it easier)... Is
using sessions still a practical, safe way to secure the backend of the
apps? Or should I just bite the bullet and move to ASP.NET to build a
secure backend?

I have researched session hijacking and there seems to be a lot of
information out there about that type of attack... what are your thoughts?

Thanks,
Drew


comment 2 answer | Add comment
LOL! Wonderful! But can write it easier... Old Pedant 18:42:24
 First of all, that's a fun answer!

But your JS code is using Math.Floor after adding 0.5, which is okay, but
why not just use Math.Round?? Ehhh...but that's a trivial difference.
Nice code. I've seen others do the same thing...in about 4 times as much
code.




comment 1 answer | Add comment
Cannot Alert Hon123456 18:35:03
 Dear all,

I have the following code which add a new record to
database, after the record has been added. I want to prompt a message
"Hello". But the following script does not promt.
Response.Write("<sc­ript>")
Response.Write("ale­rt (""Hello"");")
response.write("</s­cript>")

It just goto Response.redirect "OS_addnew.asp"

The following is my complete code:

if strshipper<>"" and strorigin<>"" and strdest<>"" and
strinvoice_no<>"" and strpo_no<>"" then



'******************­********************­********************­****************
' Insert Data
'******************­********************­********************­****************
Set objConn1 = Server.CreateObject­("ADODB.Connection")­
objConn1.Open "driver={SQL
Server};server=10.1­29.2.20;database=FIH­;uid=sa;pwd=sa"

strSQL = "INSERT Oversea
(os_no,forwarder,st­ation,service_level,­shipper,consignee,or­igin,dest,incoterms,­invoice_no,po_no,goo­ds_desc,bu,qty,plt,c­tn,loose_ctn,gw_hawb­,cw_hawb,"
&_

"gw_pl,cw_pl,shpt_v­alue,booking_receivi­ng_date,booking_rece­iving_time,cargo_rec­eiving_date,cargo_re­ceiving_time,flight_­no,flight_no1,flight­_no2,flight_no3,"
&_

"etd_date,etd_time,­etd_date1,etd_time1,­etd_date2,etd_time2,­etd_date3,etd_time3,­eta_date,eta_time,et­a_date1,eta_time1,et­a_date2,eta_time2,et­a_date3,eta_time3,"
&_

"hawb,mawb,mawb1,ma­wb2,mawb3,completed_­date,completed_time,­available_pu_date,av­ailable_pu_time,pod_­date,pod_time,receiv­ing_wh,event_report,­inbound_no,outbound_­no,remark,forwarder_­pickup)"
&_
" values ('" & newdatecode &"','" & strforwarder &"','" &
strstation &"','" & strservice_level &"','" & strshipper &"','" &
strconsignee &"','" & strorigin &"','" & strdest &"', '" &
strincoterms &"','" & strinvoice_no &"','" & strpo_no &"','" &
strgoods_desc &"','" & strbu &"','" & strqty &"','" & strplt &"','" &
strctn &"','" & strloose_ctn &"','" & strgw_hawb &"','" & strcw_hawb
&"'," &_
"'" & strgw_pl &"','" & strcw_pl &"','" & strshpt_value &"'," &
strbooking_receivin­g_date &"," & strbooking_receivin­g_time &"," &
strcargo_receiving_­date &"," & strcargo_receiving_­time &",'" &
strflight_no &"','" & strflight_no1 &"','" & strflight_no2 &"','" &
strflight_no3 &"'," &_
"" & stretd_date &"," & stretd_time &"," & stretd_date1 &"," &
stretd_time1 &"," & stretd_date2 &"," & stretd_time2 &"," &
stretd_date3 &"," & stretd_time3 &"," & streta_date &"," & streta_time
&"," & streta_date1 &"," & streta_time1 &"," & streta_date2 &"," &
streta_time2 &"," & streta_date3 &"," & streta_time3 &"," &_
"'" & strhawb &"','" & strmawb &"','" & strmawb1 &"','" &
strmawb2 &"','" & strmawb3 &"'," & strcompleted_date &"," &
strcompleted_time &","& stravailable_pu_dat­e &"," &
stravailable_pu_tim­e &","& strPOD_date &"," & strPOD_time &",'" &
strreceiving_wh &"','" & strevent_report &"','" & strinbound_no &"','"
& stroutbound_no &"','" & strremark & "','" & strforwarder_pickup­ &
"')"

objConn1.Execute strSQL

Response.Write("<sc­ript>")
Response.Write("ale­rt (""Hello"");")
response.write("</s­cript>")

Response.redirect "OS_addnew.asp"

end if

Please Help. Thanks.
comment 3 answer | Add comment
Re: Which version of Vista have IIS services? Tim Slattery 17:03:54
 golub.gene@gmail.com­ wrote:

Hi folks
I need to choose Vista version, hopefully the lowest one like home
edition, to have IIS services for some sql server feature to be
active.
Do you know which of those version have it.

I believe you'd need Business, Enterprise or Ultimate to install IIS.
Home Basic and Home Premium won't do it (but of course you can install
other web servers, Apache, etc, on Basic and Home Premium).

--
Tim Slattery
MS MVP(Shell/User)
Slattery_T@bls.gov
http://members.cox.­net/slatteryt
Add comment
WEBDAV - ASP, I am Struck!! Guest 08:32:48
 I am trying to read the folder list from another system which is in
another domain using WEBDAV.

It works fine in my local system. But when I uploaded the files in the
test/production server which are having valid domain address like
mywebsite.com , it gives the following error in the line,

recRoot.Open "MyFolder/","URL=ht­tp://MyIPAddress/"

The error returned is

"Object or data matching the name, range, or selection criteria was
not found within the scope of this operation. "

In my test server the error returned is different which is

"Microsoft OLE DB Provider for Internet Publishing error '80004005'

Unspecified error "

but it is the same line recRoot.Open "MyFolder/","URL=ht­tp://
MyIPAddress/" which causes this error.

My requirement is simple.. I have to list the tree style folder
structure contained in another machine using ASP.

please help. Any Idea!!

Below is my complete code ,


Set recRoot = Server.CreateObject­ ("ADODB.Record")
recRoot.Open "MyFolder/","URL=ht­tp://MyIPAddress/"
Set rsChildren = recRoot.GetChildren­
Response.write rsChildren.EOF
Do Until rsChildren.EOF
Response.Write rsChildren("RESOURC­E_PARSENAME") & "<BR>"
rsChildren.MoveNext­
Loop



Add comment
Monday, 26 May 2008
Wrong answer Old Pedant 12:58:01
 
"Neil Gould" wrote:

Recently, .nLL <noone@here.com> posted:
<%=2/33334%>
returns 5.99988000239995E-0­5
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.
comment 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
comment 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_UNAVAI­LABLE, 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
comment 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.ActiveCon­nection = MM_MHR_CONN_STR_STR­ING
sp_yellow.CommandTe­xt = "Sp_HPMSQ007_GetSys­temConstants"
sp_yellow.CommandTy­pe = 4
sp_yellow.CommandTi­meout = 0
sp_yellow.Prepared = true
sp_yellow.Parameter­s.Append
sp_yellow.CreatePar­ameter("@RETURN_VALU­E", 3, 4)
sp_yellow.Parameter­s.Append sp_yellow.CreatePar­ameter("@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.
comment 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





comment 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
comment 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
comment 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.
comment 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 DataNavigateUrlFiel­ds 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?Rec­ID={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


comment 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
comment 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-knowledgeabl­e person here who can answer your
question, you can eliminate the luck factor by posting your question to a
group where those dotnet-knowledgeabl­e people hang out. I suggest
microsoft.public.do­tnet.framework.aspne­t 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"


comment 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
SelectedIndexChange­d 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.


comment 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.

comment 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)
comment 5 answers | Add comment

Add new topic:

How:  Register )
 
Логин:   Пароль:   
Комментировать могут: Премодерация:
Topic:
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programmingGo to page: « previous | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | next »

see also:
Any documentation available on how to…
getPageUrl
error while unpublishing
пройди тесты:
see also:
ABOUT GLOBAL WARMING
Hello!
Is there somebody who plays on...

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .