VBA SQL Syntax - Problem with restricted keyword

Arthur.J

New Member
Joined
Jun 8, 2009
Messages
44
Hi All,
I am calling simple SQL Query in my code and getting error. I've checked and looks like query is not working because of "type" word inside query string which I believe is restricted. How I can fix it? Should I put this word in some quotas etc.?
Code is working fine for any other SQL query.

Thanks a lot in advance!

DBQuery ("select abt.type, abt.oid FROM cgs01.addressbook_type abt " _
& " "), "BK", 3
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
You could also try single or double quotes.

I did. I tried ""abt.type"", ''abt.type'', 'abt.type' and some more combinations. Still not working - it is really annoying. Spend half day to figure it out that this word is a reason for query not working.
 
Upvote 0

Forum statistics

Threads
1,224,570
Messages
6,179,610
Members
452,931
Latest member
The Monk

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top