|
Function send_mail()
Dim cnn As New ADODB.Connection
Dim send As ADODB.Recordset
Dim olkapp As Outlook.Application
Dim newmail As MailItem
Dim para As String
Dim i As Integer
Set olkapp = CreateObject("outlook.application")
cnn.ConnectionString = "provider=microsoft.jet.oledb.3.51;data source=E:\文件\原本\2006库.mdb;database password=6ersist Security Info=False"
cnn.Ope
Set send = New ADODB.Recordset
send.Open "select * from [次查询-三字代码表]", cnn, adOpenKeyset, adLockReadOnly
If send.RecordCount < 1 Then Exit Function
With send
para = "dear faf" + Chr(10)
For i = 1 To .RecordCount
para = para + Space(3) + CStr(.Fields(2)) + Chr(10)
.Move i, 1
Next i
para = para + Space(20) + "super"
End With
send.Close
Set newmail = olkapp.CreateItem(olMailItem)
With newmail
.To = ""
.Subject = "abc"
.Body = para
.send
End With
End Function
cnn.ConnectionString = "provider=microsoft.jet.oledb.3.51;data source=E:\文件\原本\2006库.mdb;database password=6ersist Security Info=False"
老是说找不到可插入的ISAM,没密码,一切正常
access97(不要说换access能换的话我也想换了),我在网上查了很多资料都没用,不知道是不是写错了,急!!!! |
|