M
Michelle
Hi,
Thank you for your help in advance.
Can you tell me where I'm going wrong with my code?
Running Excel 2007
I'm getting an -2147217904 automation error on the recordset.Open line.
strSelectedCommodity = Range("EquipmentCommodity").Value
'strSQLCommodityDesc = "SELECT [Code of Accounts].COA, [Code of
Accounts].Description FROM [Code of Accounts] WHERE [Code of Accounts].COA= "
& strSelectedCommodity & " ;"
Set recordset = New ADODB.recordset
recordset.CursorType = adOpenStatic
recordset.LockType = adLockReadOnly
'recordset.Options = adCmdText
recordset.Open strSQLCommodityDesc, UsageTracking
Thank you for your help in advance.
Can you tell me where I'm going wrong with my code?
Running Excel 2007
I'm getting an -2147217904 automation error on the recordset.Open line.
strSelectedCommodity = Range("EquipmentCommodity").Value
'strSQLCommodityDesc = "SELECT [Code of Accounts].COA, [Code of
Accounts].Description FROM [Code of Accounts] WHERE [Code of Accounts].COA= "
& strSelectedCommodity & " ;"
Set recordset = New ADODB.recordset
recordset.CursorType = adOpenStatic
recordset.LockType = adLockReadOnly
'recordset.Options = adCmdText
recordset.Open strSQLCommodityDesc, UsageTracking