View Single Post
Old 05-07-2011, 08:25 AM   #2
ggi33hg1k
 
Posts: n/a
Default

This article assumes the reader has some understanding of database connectivity technologies,ralph lauren uk, only to discuss the SQL query syntax.
table structure is as follows (MS Access 2000):
table name: userTable
----------------------
field name segment type
----------------------
userID automatically count (long integer)
userName text
user *** Text
CreateDate date / time (default Now ())
----------------------
one, with the Select command to extract the Record
1,ralph lauren sale, to obtain all the records in the table
Select command, the statement is as follows:
\userTable \\Like '% M%' \The above command can be combined, for example, to obtain the table contains userName \Like '% Ho%' Order By CreateDate DESC \SQL query command.
3), conditions of the word in the \
4), determine the conditions when more than one should be to \
Second, with the Insert Into command to insert a new record
1,ralph lauren clothing, insert a new record
\br> Description:
It should be noted that the value inserted into the types of records should be consistent with the type field in the table, otherwise it will go wrong. In fact, just using single quotes and convenient method, but not standardized, because if you want to insert the record itself contains single quotes, an error (although this does not happen often, but there may exist). So we best to use a custom function to replace the single quotes. As follows
Function SqlStr (data)
SqlStr = \Function
in the command was:
Dim Name,ralph lauren polo sale, ***
Name = \userName, user ***) Values (\or double quotes are not wrong.
Note, however, this rule applies only to type the text field, if other types are generally no need to consider that do not add any symbol.
three, with the Update to update records
1,ralph lauren shop, update all records all fields
\= \
2, update the userName field value, \
combination of conditions necessary inquiries, the method with the Select. Another issue here should pay attention to single quotes.
Fourth, Delete to delete records
1,ralph lauren outlet, delete all records
\; Delete From userTable Where userID = 20 \*= 'F' And userName Like '% Zhang%' \
  Reply With Quote

Sponsored Links