hi
this is my code for pulling the info from the excel spreadsheet
is seem to work so happy days
now its the next part i cant get i need to put that into the table. but i have to stick to the structure in here so can any one help please.Code:Dim xl As New Excel.Application Dim xlsheet As Excel.Worksheet Dim xlwbook As Excel.Workbook ' Const SHEET_NAME As String = "CreditRatings" Dim i As Integer Dim j As Integer Dim sBuffer As String Dim LastRowColB As Integer Dim fn As Integer Set xlwbook = xl.Workbooks.Open("c:\CreditRatingsReport.xls") Set xlsheet = xlwbook.Sheets.Item("CreditRatings") LastRowColB = xl.Range("B65536").End(xlUp).row fn = FreeFile 'Open sOUTPUT_PATH & "\Ivory_SecuritiesIssued" & ".csv" For Append As #fn For i = 2 To LastRowColB sBuffer = "" For j = 1 To 24 If IsDate(xlsheet.Cells(i, j)) Then sBuffer = sBuffer & Format(xlsheet.Cells(i, j)) & "|" Else sBuffer = sBuffer & Trim(xlsheet.Cells(i, j)) & "|" End If Next j ' MsgBox sBuffer Next i
i need to get to to put the info into the table buy doing it something like this
its the middle part i can figure out the insert into table part anyone have any ideasCode:DBCALL "SELECT", "ACRT", Cmd$ -- calls the table in the database Cmd$ = "INSERT INTO ACRT (CNO, MoodysRate, SNPRate, FITCHRate, MoodysWatch, snPWatch, FITCHWatch, MoodysIRB) Values ) DBCALL "add", "ACRT", Cmd$ adds the info into tthe table If result <> dbSUCCESS And result <> 100 Then MsgBox "Data Base Unavailable or Unexpected error in Data Base or batch running." Message 43 result = 1 End If




Reply With Quote