In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "SQLServer and Access database ASP code what is the difference", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "what is the difference between SQLServer and Access database ASP code"!
Backend database: after [MicrosoftAccess] and [MicrosoftSqlServer] are replaced, the ASP code should pay attention to some changes:
1. Connection problem (for example)
[MicrosoftAccess] constr= "DBQ=c:\ data\ clwz.mdb;DRIVER= {MicrosoftAccessDriver (* .mdb)}" [MicrosoftSqlServer] constr= "DRIVER= {SQLServer}; SERVER=host;DATABASE=mydata;uid=sa;pwd="
2. Similarity function (for example)
[1] DATEDIFF (datepart,startdate,enddate), where the "datepart" parameter is optional as follows:
Setting description-[MicrosoftAccess] year yyyy quarter Q month m days in a year y days d days in a week w weeks ww hours h minutes n seconds [Microsoft SQL Server] yearyy,yyyyquarterqq,qmonthmm,mdayofyeardy,ydaydd,dweekwk,wwhourhhminutemi,nsecondss,smillisecondms
Basically, it is almost the same, but it is important to note that when writing, [MicrosoftAccess] should be in quotation marks, such as: datediff ('dcentenddjobo 2004 MicrosoftSqlServer 01'), and [MicrosoftSqlServer] does not need it, such as datediff.
Data type functions such as cstr can be used in [2] [MicrosoftAccess], while convert or cast functions are used in [MicrosoftSqlServer], such as convert (varchar, [amount]), etc.
[3] [MicrosoftSqlServer] take the current time with getdate and so on.
What are the differences between SQLServer and Access database ASP code
III. Sentence
[MicrosoftSqlServer] can be used
CASEWHENTHENWHENTHEN...ELSEEND
Statement, which is not supported by [MicrosoftAccess]. [MicrosoftAccess] does not support between statements, but [MicrosoftSqlServer] can write: [date] between@date1and@date2.
Fourth, query table
[MicrosoftSqlServer] can have three or more table join queries, while [MicrosoftAccess] seems to be able to join queries with only two tables (pending authoritative confirmation), and [MicrosoftSqlServer] can use "* =" and "= *" connectors.
V. the problem of dividing by zero
[MicrosoftAccess] automatically discards the relevant record when it encounters a divisor of 00:00, while [MicrosoftSqlServer] reports an error and the query is aborted. Delete code: [MicrosoftAccess] can write: delete*from [table], [MicrosoftSQLServer] can only be written like this: delete from [table] more * will report an error.
Current date: [MicrosoftAccess] use date (), [MicrosoftSQLServer], use getdate () if the database may change the type, you can add something like this to the ASP code:
IfinStr (constr, "MicrosoftAccess") > 0thensqlstrl = [MicrosoftAccess] [sql Code] elsesqlstr= [Microsoft SQL Server] [sql Code] endif
In this way, even if you change the database, there is no need to change the database query update code. Add: there are field records of true and false in access, but only smallint in sql. If there is "field name = true" in access, it should be changed to "field name = 1" in sql. Most free asp programs on the Internet use access database. However, as a small and medium-sized stand-alone database system, access database is often overwhelmed when it undertakes the website application with a large amount of visits and data.
It is generally believed that the performance of access databases with more than 50m begins to decline significantly, and after more than 100m, the problems of errors and slow running will be more prominent. Although it can be optimized as much as possible from the point of view of the program to improve performance, as after Mobile 7.0, it can not fundamentally solve the problem. At this time, perhaps using Microsoft's SQLServer database is the most possible way, of course, you can also use other things such as Oracle, MySQL and so on, but as a rewriting, because it is also a Microsoft product, rewriting to SQLServer should be the most labor-saving way.
Thank you for your reading, the above is "what is the difference between SQLServer and Access database ASP code", after the study of this article, I believe you have a deeper understanding of what is the difference between SQLServer and Access database ASP code, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.