Microsoft company offerred unified data to visit interface ActiveX Data Object, abbreviation ADO. But in applying process designing actually, visit different database, be like Access, SQL Server or VFP, can put in a few “ subtle ” difference, often have such case, the program that visits some database with ADO object is debugged passed, but with same program visit other database exists such or in that way problem, conversely same also. This differentia is not like meaning of it doesn't matter in light of the author, because be the product of a company; Although this kind of difference is not much, but the cause and effect that should make clear it, enough makes an user busy a period of time, a for no reason increased the burden of the user. Below, the article discusses a few differences that visitting different database field about SELECT statement.
In SQL Server, Access, VFP3 the data list that there are names of such the following a watch to be “Employee” respectively in the database. If pursue,1 is shown.
Graph 1
Visit the difference of date field
Visit this piece of watch of these 3 databases below most circumstance with SELECT statement respectively, without what distinction, namely if you wrote the SELECT sentence that visits SQL Server database, can use at visitting Access database or VFP database likewise, should change connective data source only can. But if you want the word that to ” of “ birth date this one date field has inquiring, the issue came, want inquiry to expected to the employee endowment December 31, 1985 on January 1, 1980 for example, the statement that the data in visitting SQL Server expresses is:
Between '1980-01-01' And '1985-12-31' of birth date of Select * From Employee Where
If ground of assume sth as a matter of course uses this statement to visit Access database that is off base, must add function DateValue () , write a law correctly to be as follows:
Between DateValue of birth date of Select * From Employee Where ('1980-01-01' ) And DateValue ('1985-12-31' )
If want to visit VFP date field to must use again the following this kind writes a law:
Between {^1980-01-01} And {^1985-12-31} of birth date of Select * From Employee Where
Above is SELECT statement the difference of the date of different to the visit database field, do not understand this differentia to fasten, you can be done to get confused and disoriented, do not know a fault where to be.
The difference of statistical respect
To going up the Employee data of the exemple is expressed, press sectional statistic total pay and number, write a paragraph of statistic and indication code with VB, if had built join object Conn, record collect object RS, already received some data source repeatedly, specific code is shown as follows:
Open join object Conn ' to be able to open source of data of SQL Server, Access, VFP
Previous12 Next