Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What’s the use of “GLOBAL.ASAX” file?

1097


What is difference between session and application in asp net?

1025


What r the asp.net list controls and diff. Between them?

983


What are session state modes in asp.net?

1035


Explain security types in asp.net?

1106


What is the difference between asp.net mvc and asp.net webforms? : asp.net mvc

1044


What is virtual directory in asp.net?

1054


What is round trip in asp.net?

938


What is the difference between trace and debug in asp.net?

1139


benefits of migration from asp to asp.net hi frnds, i have to give presentation to a client about how useful would be migrating their project from asp to asp.net .plz give me some points which i should incorporate in my ppt thanks

2357


Describe state management in asp.net?

1057


Web API uses which library for JSON serialization?

1073


How do u declare static variable and how it is declared and what is its lifetime?

1034


What is strong-typing versus weak-typing?

1125


What is query string in asp.net?

1071