It's your square brackets that are causing the problem. The way you have written the code, the query sent to the server isselect * from [memberships] where [ membershipid between 1 and 100]
If you change the code tosqlStr = "SELECT * FROM [" & tableName & "] WHERE " & fieldName
it will work for this specific example. If you want to escape the column names in the where condition using square brackets, you can escape them in the parameters you sent in - like thisSet BigCom = insertObj.Query(thisMemberCode, conn,"memberships"," [membershipid] between 1 and 100")