What is the difference between Server.Transfer and
Response.Redirect? Why would you choose one over the other?
Answer Posted / xy
Set exCon = Server.CreateObject( "ADODB.Connection" )
Set dbCon = Server.CreateObject
( "ADODB.Connection" )
'open connection to excel
'had to use the JET driver since some of
the ODBC functionality didnt work
exCon.ConnectionTimeout = 30
' exCon.open "Driver={Microsoft Excel Driver
(*.xls)};Dbq=" & Filepath & ";UID=admin;TypeGuessRows=0;"
exCon.open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Filepath & ";Extended Properties=""Excel
8.0;IMEX=1;ImportMixedTypes=Text;TypeGuessRows=0"""
exCon.CommandTimeout = 90
'open connection to DB
openDBConnection(dbCon)
set rs=exCon.OpenSchema(20)
strPageName = rs(2)
'ADO replaces a ' with a '' by default. we
need to undo this change during the import.
if instr(strPageName, "''") > 0 then
response.write "The name of the
Spreadsheet tab cannot have a comma. "
response.write "The current name
["& replace(strPageName,"''","'") &"] must be corrected
before it can be uploaded.<BR>"
response.End()
end if
response.write "Page <B>" & strPagename
& "</B> was imported"
rs.close
set rs=nothing
Set RS = Server.CreateObject
("ADODB.Recordset")
RS.ActiveConnection = exCon
RS.CursorType =
1
RS.LockType =
1
RS.Source = "SELECT * FROM [" &
strPageName & "] where siteno is not null and projcode = '"
& strProjCode & "'"
RS.Open
if not rs.eof then
arrData = rs.getrows()
else
response.redirect "/error.asp?msg=Template Projcode
Mismatch ! (" & Request.ServerVariables("URL") & ")"
response.end
end if
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How do you remove duplicates without using remove duplicate stage?
Why is an object pool required?
Explain the main differences between asp and asp.net?
If you have an application with multiple security levels though secure login and my ASP.NET web appplication is spanned across three web-servers by using round-robbin load balancing. Explain which is the best approach to maintain login-in state for the users?
What is the difference between user control an custom control?
What is the significance of attaching a profile while creating a user?
Explain page output caching?
what is loosely coupled solution? How it can be used?
Can we have 2 web config files?
How tooltip is set through code-behind in ASP.NET?
List the advantages and disadvantages of user control an custom control?
What is directive in asp net?
Describe state management in asp.net?
What is the state management in asp.net?
What is authentication in asp.net?