Вы находитесь на странице: 1из 33

2011

WHERE
SELECT Id, FullNAme, Ragaz, Pla, Mucha ,Nawnishan, Brwanama, Pspory, Shwiny_Kar ,Barwary_Ladaikbun, Barwary_Damazrandn FROM Information WHERE Ragaz = ""

Like
SELECT Id, FullNAme, Pla, Mucha, Nawnishan, Brwanama, Pspory, Shwiny_Kar, Barwary_Ladaikbun, Barwary_Damazrandn, Ragaz FROM Information WHERE FullNAme Like *' & ] '*' & [

Format
Format(Now(),"dd / mm / yyyy") AS FormatDate

DateDiff
DateDiff (yyyy",]Barwary_Damazrandn[,now()) AS Years DateDiff (m",]Barwary_Damazrandn[,now()) AS Month DateDiff (d",]Barwary_Damazrandn[,now()) As Day

IIf
IIf( [ Fieldname ]=0,[True],[False]) AS name IIf ( [ day]=0,[day],[Day]-1) AS Days

VBA
Visual Basic for Application

Private Sub Form_Timer() s=s+1 a = "Institute of Computer" If s < 22 Then Label5.Caption = Right(a, s) Else End If If s > 21 Then Label5.Caption = " " + Label5.Caption Else End If If s > 60 Then s = 0 End Sub

Add 1
DoCmd.RunSQL ("insert into table1 (user,pass) values(aa,bb)") aa = "" bb = ""

Add 2
Dim DB As Database Dim RS As Recordset Set DB = CurrentDb Set RS = DB.OpenRecordset("inf") While RS.EOF() = False RSt.AddNew

Add 2
RS![no1] =t1 RS![name1] =t2 RS![joB] =t3 RS![salary] =t4 RSt.Update RS.Move 1 Wend

Add 3
Dim db As Database Dim rs As Recordset

Set db = CurrentDb Set rs = db.OpenRecordset("table2")

rs.AddNew rs![no] = t1 rs![name] = t2 rs![add] = t3 rs![tel] = t4 rs![mony] = t5 rs![pic] = a rs.Update

If Command12.Caption = "new" Then t1.Enabled = True t2.Enabled = True t3.Enabled = True t4.Enabled = True t5.Enabled = True Image3.Visible = True Command12.Caption = "add"

Else t1.Enabled = False t2.Enabled = False t3.Enabled = False t4.Enabled = False t5.Enabled = False Image3.Visible = False Command12.Caption = "new" End If t1.Value = 0 t2 = ""

Search 1
a = InputBox(Input Number") Dim db As Database Dim rs As Recordset Set db = CurrentDb Set rs = db.OpenRecordset("table2") While rs.EOF = False If rs![no] = Val(a) Then

T1 = rs![no] T2 = rs![Name] T3 = rs![Address] T4 = rs![telno] T5 = rs![Date] T6 = rs![money] Image6.Picture = rs![Picture]

T1.Enabled = True T2.Enabled = True T3.Enabled = True T4.Enabled = True T5.Enabled = True T6.Enabled = True Cpicture.Enabled = True Else End If rs.Move 1 Wend

Search 2
Dim DB As Database Dim RS As Recordset Dim y As Integer y=0 Set DB = CurrentDb
Set RS = DB.OpenRecordset("SELECT * FROM INF WHERE NO1=" + " + T1 + ")

y = RS.RecordCount()

If y = 0 Then MsgBox "no found" Else T2 = RS![name1] T3 = RS![joB] T4 = RS![sha] T5 = RS![salary] End If

Update 1
Dim db As Database Dim rs As Recordset Set db = CurrentDb Set rs = db.OpenRecordset("table22") While rs.EOF = False If rs![no] = Val(a) Then rs.Edit

rs![no] = t1 rs![name] = t2 rs![Address] = t3 rs![telno] = t4 rs![Date] = t5 rs![money] = T6 rs![Picture] = Image6.Picture rs.Update t1 = "" t2 = "" t3 = "" t4 = "" t5 = "" T6 = ""

Else End If rs.Move 1 Wend

Update 2
DoCmd.RunSQL ("update inf set name1=" + "'" + t2 + "'" + "where no1=" + "'" + t1 + "'") DoCmd.RunSQL ("update inf set salary=" + "'" + t5 + "'" + "where no1=" + "'" + t1 + "'")

Delete 1
b = MsgBox( Are You Sure ", vbYesNo) If b = 6 Then Dim db As Database Dim rs As Recordset Set db = CurrentDb Set rs = db.OpenRecordset("table22") While rs.EOF = False If rs![no] = Val(t1) Then rs.Delete

t1 = "" t2 = "" t3 = "" t4 = "" t5 = "" T6 = "" Image6.Picture = "" Else End If rs.Move 1 Wend Else End If

Delete 2
DoCmd.RunSQL
("delete from table1 where user=" + "'" + aa + "'")

aa = "" bb = ""

Login
Dim db As Database Dim rs As Recordset Set db = CurrentDb Set rs = db.OpenRecordset("table1") p=0

While rs.EOF() = False If Text0 = rs![user] And Text2 = rs![pasword] Then p=1 a = rs![admin] Else End If rs.Move 1 Wend

If p = 0 Then MsgBox "sorry" Else If a = True Then DoCmd.OpenForm "form2" DoCmd.Close acForm, "form1" Else DoCmd.OpenForm "form3" DoCmd.Close acForm, "form1" End If End If

Вам также может понравиться