R
RON GIBSON
I got the following to work but it only takes the last record. Can someone
look at the code to see what is wrong.
Ron
Sub Date_Import()
dbfullname = "C:\dates1.mdb"
Dim cn As ADODB.Connection, rs As ADODB.Recordset, intColIndex As Integer
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
dbfullname & ";"
Set rs = New ADODB.Recordset
rs.Open "select * from date1", cn
Dim myOlApp As Outlook.Application
Dim myApptItem As Outlook.AppointmentItem
Dim myRecurrPatt As Outlook.RecurrencePattern
Dim myNamespace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Dim myItems As Outlook.Items
Dim myDate As Date
Dim myOddApptItem As Outlook.AppointmentItem
Dim saveSubject As String
Dim newDate As Date
Dim myException As Outlook.Exception
Set myOlApp = New Outlook.Application
Set myApptItem = myOlApp.CreateItem(olAppointmentItem)
Do Until rs.EOF
myApptItem.Start = rs("date1")
myApptItem.End = rs("date1")
myApptItem.Subject = rs("des")
myApptItem.Save
rs.MoveNext
Loop
End Sub
look at the code to see what is wrong.
Ron
Sub Date_Import()
dbfullname = "C:\dates1.mdb"
Dim cn As ADODB.Connection, rs As ADODB.Recordset, intColIndex As Integer
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
dbfullname & ";"
Set rs = New ADODB.Recordset
rs.Open "select * from date1", cn
Dim myOlApp As Outlook.Application
Dim myApptItem As Outlook.AppointmentItem
Dim myRecurrPatt As Outlook.RecurrencePattern
Dim myNamespace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Dim myItems As Outlook.Items
Dim myDate As Date
Dim myOddApptItem As Outlook.AppointmentItem
Dim saveSubject As String
Dim newDate As Date
Dim myException As Outlook.Exception
Set myOlApp = New Outlook.Application
Set myApptItem = myOlApp.CreateItem(olAppointmentItem)
Do Until rs.EOF
myApptItem.Start = rs("date1")
myApptItem.End = rs("date1")
myApptItem.Subject = rs("des")
myApptItem.Save
rs.MoveNext
Loop
End Sub