Jump to content

use MS SQL


khadem1386

Recommended Posts

HiThis code is very slower than access and I 'm wonder why!I 'm new in MS SQL 2005.This table have about 42,000 recodes and 2 fields (nchar(2) , int) where is problem?

<!--- #include file="path.asp" --><%Server.ScriptTimeout=200%><%strSQLServerName = "xxxx.xxxxx.com"strSQLDBUserName = "xxxxx_xxxxx"strSQLDBPassword = "xxxxxxx" ' xxxxstrSQLDBName = "xxxxxxx_xxxxx" '"BANK_NAME"'MS SQL Server OLE DriverstrCon = "Provider=SQLOLEDB;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";"Set sqlCon = Server.CreateObject("ADODB.Connection")sqlCon.connectionstring = strConsqlCon.Openset REstateZipcode = Server.CreateObject("ADODB.Recordset")  		REstateZipcode.Open "Select * from zipcode order by state" , sqlCon ,3,3		   REstateZipcode.MoveFirstwhile Not REstateZipcode.EOF %> <% = REstateZipcode("State") %>____ <% = REstateZipcode("ZipcodeID") %> <BR><%REstateZipcode.MoveNextwendREstateZipcode.close sqlCon.close %>

when this code run it hang about 50 seconds then start to write and transfer date to client. but if use this code by access it run and start write date immediately. Thanks for any help

Link to comment
Share on other sites

It would probably speed it up if the SQL code was changed to remove the *Select State, ZipcodeID from zipcode order by state

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...