Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel
#3
Not Solved
Hi,
This would help you to query from the Excel Sheet

Code:
'Set oCnnExcel = CreateObject("ADODB.Connection")
'Set oRsExcel = CreateObject("ADODB.Recordset")

'DbExcelPath = "D:\Manojith_Others\All_others\Database.xls"
'oCnnExcel.Open "Driver={Microsoft Excel Driver (*.xls)};DBQ=" & Trim(DbExcelPath) & ";Readonly=1;" 'DSN
'oRsExcel.Open "SELECT * FROM [TEST_01_UC01$] WHERE IdNo IN ('123','124') ORDER BY IdNo, CompanySal, CompanyName Asc", oCnnExcel, 2, 3

'oRsExcel.MoveFirst
'Do While oRsExcel.EOF = False
'    MsgBox oRsExcel.Fields("CompanyName").Value
'    MsgBox oRsExcel.Fields("CompanySal").Value
'    oRsExcel.MoveNext
'Loop
Reply


Messages In This Thread
Excel - by lit_73 - 05-19-2009, 02:21 PM
RE: Excel - by Ankur - 05-19-2009, 03:06 PM
RE: Excel - by manojith1984 - 05-20-2009, 11:11 AM
RE: Excel - by lit_73 - 06-22-2009, 05:23 PM
RE: Excel - by lit_73 - 06-23-2009, 06:03 PM
RE: Excel - by manojith1984 - 06-24-2009, 02:16 PM
RE: Excel - by savita.kale - 08-04-2009, 06:08 PM
RE: Excel - by linhke - 12-10-2009, 07:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)