Forum Discussion
simonb
7 years agoRegular Visitor
Using Paramters to define ODBC connection
Hi, Wondering if there's a way to use a parameter to define the ODBC Data source. I want to connect via CData's ODBC driver for Xero. This provides access to multiple tables via SQL statements. I...
parry2k
7 years agoSuper User
simonb I believe it would be like below, assuming your parameter name is Connection
= Odbc.Query("dsn=" & [Connection] & ", "Select * from TrialBalance where date=[PeriodEnding]")simonb
7 years agoRegular Visitor
parry2k thanks, that returns a Token Comma Expected error highlighting Select
I've tried a few iterations but can't find one that works...any thoughts?
Thanks,
Simon
- parry2k7 years agoSuper User
simonb sorry I had typo in my message, try this
= Odbc.Query("dsn=" & [Connection] & ", Select * from TrialBalance where date=[PeriodEnding]")- simonb7 years agoRegular Visitor
That changes the error to:
Expression.Error: There is an unknown identifier. Did you use the [field] shorthand for a _[field] outside of an 'each' expression?
Sorry!
- klinejordan7 years agoAdvocate II
I think this will work:
= Odbc.Query("dsn=" & Connection & "", Select * from TrialBalance where date=[PeriodEnding]")