#  Other Applications & Softwares  > Access Tables & Databases >  >  vba method 'execute' of object '_Connection' failed

## fmsd91

Hello all,
I have an issue on VBA when exporting a table inside a database into another table with a select query.
I get the error:

method 'execute' of object '_Connection' failed

The problem is that if I include in the query a field called 'Size' which is the only one with double precision I get the error, if not the script runs ok.

The code:

Set rs = conn.Execute("SELECT " + tblname + ".Ctry, " + tblname + ".Ctry2, " + tblname + ".UniqueAgglomerationId as UniqueAgglomerationId10, " + tblname + ".RLID as RLID10, " + tblname + ".NumberOfInhabitants as NumberOfInhabitants10, " & _
                    tblname + ".Size as Size10, " + tblname + ".DeliveryID as DeliveryID10, " + tblname + ".DeliveryStr as DeliveryStr10, " + tblname + ".AggloNameEn as NameEn10, " + tblname + ".Link as Link10 INTO agg_05_10 IN '" + Me.Dir1.Path + "\" + Ctrycode + "_inter.accdb' FROM " + tblname + " WHERE " & _
                    CC + ";", , adCmdText)

What could be leading to the error?  :Confused: 
Regards,

Francisco

----------


## Izandol

Is probably reserved word. You may try to use .[Size] in place of .Size

----------


## alansidman

Check this list of SQL reserved words

https://msdn.microsoft.com/en-us/lib...ectionSection7

----------


## fmsd91

Thanks a lot! It worked fine with the .[Size] solution!  :Smilie:

----------

