פארוואס בלייבט די קאנעקשאן אפן?
פארעפענטליכט: דינסטאג אוקטובר 11, 2011 5:20 pm
א פיעס אוו קאוד
איך שרייב קלאר ער זאל צימאכן די קאנעקשאן אבער ער בלייבט אפן און נאכן פייערען עטליכע מאל גיט ער אן ערראר
איך שרייב קלאר ער זאל צימאכן די קאנעקשאן אבער ער בלייבט אפן און נאכן פייערען עטליכע מאל גיט ער אן ערראר
- קאוד:
Dim cnJetDB As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=yl.mdb")
cnJetDB.Open()
Dim strSQL As String
strSQL = "Select EFirst & ' ' & ELast & ' ' & Address1 as fullname, Balance, TTBal, YLBal From Members where EFirst Like '" & sFirstName & "%' and ELast Like '" & sLastName & "%'"
'strSQL = "Select HFirst, HLast From Master where HFirst Like '" & sFirstName & "%' and HLast Like '" & sLastName & "%'"
Dim cmdJetDB As New OleDbCommand(strSQL, cnJetDB)
Dim reader As OleDb.OleDbDataReader, strmsg As String
strmsg = ""
reader = cmdJetDB.ExecuteReader
While reader.Read()
strmsg = strmsg & reader.Item(0) & " : $" & reader.Item(1) & _
" TTBAL: $" & reader.Item(2) & " YLBAL: $" & reader.Item(3) & vbCrLf
End While
If Len(strmsg) = 0 Then strmsg = "No Balances Found!"
Return strmsg
reader.Close()
cmdJetDB.Dispose()
cnJetDB.Close()