Skip to main content

AccessTr.neT


Sql Kodun Düzenlenmesi Hakkında

Sql Kodun Düzenlenmesi Hakkında

#7
veri tabanını bölerek 8-10 bilgisayarın bulunduğu bir ağ da kullanılacağız
Cevapla
#8
Merhaba, makroları siz mi yazdınız bilmiyorum ama bir an önce Vba kodu yazmayı öğrenmelisiniz. Makrolarla bu iş yürümez,

recorder isimli makroda, status Sql ifadesini

INSERT INTO Comments (Bug, User,  CTimestamp, Comment, History) VALUES([ID], [TempVars]![CurrentUserID],Now(),[Status], 1)
Kodu ile değiştir.
Comments modülündeki GetComments fonksiyonunu aşağıdaki ile değiştir.
Public Function GetComments()

   On Error GoTo ErrorHandler

   Dim dbs As DAO.Database
   Dim rst As DAO.Recordset
   Dim query As String
   Dim commentsStr As String
   commentsStr = ""
   
   ' Construct our parameterized query to select the relevent comments
   query = "SELECT * FROM Comments, Users WHERE Comments.User = Users.ID AND Comments.Bug = " & TempVars!CurrentID & " ORDER BY CTimestamp desc"
   
   ' Open the resulting record set for the query
   Set dbs = CurrentDb
   Set rst = dbs.OpenRecordset(query)

   '
   With rst
       ' While there exist records in the record set, iterate through them and construct our string
       Do While Not rst.EOF
           ' If this comment has been marked as a history entry, then display it as such
           If rst.Fields("History") = 1 Then
               commentsStr = commentsStr & "<font color=""#3F3F3F"" size=""2""><i>"
               commentsStr = commentsStr & rst.Fields("Username") & " durumu "
               commentsStr = commentsStr & rst.Fields("Comment") & " olarak değiştirdi. Zaman:"
               commentsStr = commentsStr & rst.Fields("CTimestamp") & ""
               commentsStr = commentsStr & "</i></font>"
               commentsStr = commentsStr & "<br /><br />"
           ' Otherwise simply construct our standard comment string
           Else
               commentsStr = commentsStr & "<strong>"
               commentsStr = commentsStr & rst.Fields("CTimestamp")
               commentsStr = commentsStr & "<font color=""#0F0F0F"" size=""2"">  by  "
               commentsStr = commentsStr & rst.Fields("Username")
               commentsStr = commentsStr & "</strong>"
               commentsStr = commentsStr & "<br />"
               commentsStr = commentsStr & rst.Fields("Comment")
               commentsStr = commentsStr & "<br /><br />"
           End If
           ' Go to the next record (comment) in the set
           rst.MoveNext
       Loop
   End With
   
   rst.Close

   ' Ensure that we properly display newlines
   commentsStr = Replace(commentsStr, vbCrLf, "<br />")
   
   ' Push the string into the comment box on the form (display it!)
   Forms![Bug Details]!CommentsBox.Value = commentsStr

ExitProcedure:
   Exit Function
   
ErrorHandler:
   Resume ExitProcedure

End Function
Cevapla
#9
teşekkür ediyorum 
şimdilik bu işimi görecek gibi
bütün kodları Vba yapmaya gelince de , biraz zamana ihtiyacım var daha çok da öğrenmeye 
danışmam gereken olursa bu konu üzerinden konuşabilirmiyiz
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da
Task