S SLKDS Registered User. Local time Today, 10:46 Joined Jun 24, 2015 Messages 14 Jul 8, 2015 #1 Which reference to be added to use Recordset object in Excel VBA. I added "Microsoft DAO 3.6 Object Library" reference but still its not working. Plz help me on this. Thank in advance
Which reference to be added to use Recordset object in Excel VBA. I added "Microsoft DAO 3.6 Object Library" reference but still its not working. Plz help me on this. Thank in advance
GohDiamond "Access- Imagineer that!" Local time Today, 00:16 Joined Nov 1, 2006 Messages 550 Jul 8, 2015 #2 What Error are you getting? Show your DAO Opening code. Goh
S SLKDS Registered User. Local time Today, 10:46 Joined Jun 24, 2015 Messages 14 Jul 9, 2015 #3 I declare recordset as below and tried to set its value: Dim rst As Recordset strSQL = "SELECT * FROM Product WHERE OrderNo" _ & " ='" & Order_No & "';" Set rst = dbs.OpenRecordset(strSQL) ----Error line say Object doesn't support this method
I declare recordset as below and tried to set its value: Dim rst As Recordset strSQL = "SELECT * FROM Product WHERE OrderNo" _ & " ='" & Order_No & "';" Set rst = dbs.OpenRecordset(strSQL) ----Error line say Object doesn't support this method
N namliam The Mailman - AWF VIP Local time Today, 06:16 Joined Aug 11, 2003 Messages 11,685 Jul 9, 2015 #4 where do you declare and define your dbs?
S SLKDS Registered User. Local time Today, 10:46 Joined Jun 24, 2015 Messages 14 Jul 9, 2015 #5 Dim dbs As Object Set dbs = CreateObject("Access.Application") dbs.OpenCurrentDatabase "..Path of DB.accdb" Dim rst As Recordset strSQL = "SELECT * FROM Product WHERE OrderNo" _ & " ='" & Order_No & "';" Set rst = dbs.OpenRecordset(strSQL) ----Error line say Object doesn't support this method
Dim dbs As Object Set dbs = CreateObject("Access.Application") dbs.OpenCurrentDatabase "..Path of DB.accdb" Dim rst As Recordset strSQL = "SELECT * FROM Product WHERE OrderNo" _ & " ='" & Order_No & "';" Set rst = dbs.OpenRecordset(strSQL) ----Error line say Object doesn't support this method
N namliam The Mailman - AWF VIP Local time Today, 06:16 Joined Aug 11, 2003 Messages 11,685 Jul 9, 2015 #6 one thing that jumps to mind... Order_no is generaly a number field... If it is too in your case... try Code: strSQL = "SELECT * FROM Product WHERE OrderNo" _ & " = " & Order_No & ""
one thing that jumps to mind... Order_no is generaly a number field... If it is too in your case... try Code: strSQL = "SELECT * FROM Product WHERE OrderNo" _ & " = " & Order_No & ""
S SLKDS Registered User. Local time Today, 10:46 Joined Jun 24, 2015 Messages 14 Jul 9, 2015 #7 No,Its text field in my case
V vbaInet AWF VIP Local time Today, 05:16 Joined Jan 22, 2010 Messages 26,328 Jul 9, 2015 #8 It's referencing the ADODB Recordset object. Be explicit: SLKDS said: Dim rst As DAO.Recordset ----Error line say Object doesn't support this method Click to expand...
It's referencing the ADODB Recordset object. Be explicit: SLKDS said: Dim rst As DAO.Recordset ----Error line say Object doesn't support this method Click to expand...
S SLKDS Registered User. Local time Today, 10:46 Joined Jun 24, 2015 Messages 14 Jul 9, 2015 #9 I'll try that and get back to you. thank you