Sql query causing error 2950

This SQL query was generated by Microsoft Access 2003 and works fine on startup, but fails when trying to run from a macro. Is there an obvious error in the request, or for some reason this won't work?

SELECT tblAuction.article_no, tblAuction.article_name, tblAuction.subtitle, tblAuction.current_bid, tblAuction.start_price, tblAuction.bid_count, tblAuction.quant_total, tblAuction.quant_sold, tblAuction.start, tblAuction.ends, tblAuction.origin_end, tblUser.user_name, tblAuction.best_bidder_id, tblAuction.finished, tblAuction.watch, tblAuction.buyitnow_price, tblAuction.pic_url, tblAuction.private_auction, tblAuction.auction_type, tblAuction.insert_date, tblAuction.update_date, tblAuction.cat_1_id, tblAuction.cat_2_id, tblAuction.article_desc, tblAuction.countrycode, tblAuction.location, tblAuction.condition, tblAuction.revised, tblAuction.paypal_accept, tblAuction.pre_terminated, tblAuction.shipping_to, tblAuction.fee_insertion, tblAuction.fee_final, tblAuction.fee_listing, tblAuction.pic_xxl, tblAuction.pic_diashow, tblAuction.pic_count, tblAuction.item_site_id
FROM tblUser INNER JOIN tblAuction ON tblUser.id = tblAuction.seller_id;

      

0


source to share


3 answers


Did you mean from Access Macro or from VBScript or from VBA? If you have a macro that invokes an action then my recommendation would be to convert it to a VBA statement. I am assuming that when you say it works fine at startup, you mean running as an Access query. You do not specify whether the database is local or remote (i.e. SQL Server). Assuming it's local then it works that the SQL statement from VBA should work.



0


source


This article is for Access 2007, but you may be experiencing this too.



What level of security do you use in Access? (Open MDB, then go to Tools \ Macro \ Security ...). Try lowering your security level and see if that helps.

0


source


I noticed that you used keywords like INSERT and UPDATE as part of your field names. Such words can be parsed as SQL statements when sent through a macro, resulting in an error.

Can you try to put them between the [brackets]? Anyway, it would be better to change the field names.

0


source







All Articles