I am attempting to open a recordset using VB 6 and Access using the following:
Set mrsAppProd = New ADODB.Recordset
mrsAppProd.ActiveConnection = gcnMain
mrsAppProd.CursorType = adOpenKeyset
mrsAppProd.Source = "SELECT DISTINCT Inventory.Inv_itemname FROM( Inventory INNER JOIN ApprovedProduct ON Inventory.Inv_itemID = ApprovedProduct.AppProd_itemID) INNER JOIN Customer ON ApprovedProduct.AppProd_customerID = Customer.Cust_customerID Where Customer.Cust_customerID = " & gstrCustomerID
mrsAppProd.Open
I am getting a run time error that reads:
Visual Basic Error - 2147217900 Syntax error (missing operator) in query expression...
I've run the query in Access and it works fine.
Any help would be appreciated.
Set mrsAppProd = New ADODB.Recordset
mrsAppProd.ActiveConnection = gcnMain
mrsAppProd.CursorType = adOpenKeyset
mrsAppProd.Source = "SELECT DISTINCT Inventory.Inv_itemname FROM( Inventory INNER JOIN ApprovedProduct ON Inventory.Inv_itemID = ApprovedProduct.AppProd_itemID) INNER JOIN Customer ON ApprovedProduct.AppProd_customerID = Customer.Cust_customerID Where Customer.Cust_customerID = " & gstrCustomerID
mrsAppProd.Open
I am getting a run time error that reads:
Visual Basic Error - 2147217900 Syntax error (missing operator) in query expression...
I've run the query in Access and it works fine.
Any help would be appreciated.