Hello,
I can’t seem to find the answer to my problem on the forums so I thought I would post it here. I’m trying to select a range of records from another Navision Database from within Navision. I can get it to work great if the table I am querying doesn’t have a space in the name.
This select statement works perfectly: ADORst.Open(‘Select * from $Item’,ADOConn,2,3);
This does not: ADORst.Open(‘Select * from $My Table’,ADOConn,2,3);
I have tried:
ADORst.Open(‘Select * from [$My Table]’,ADOConn,2,3);
ADORst.Open(‘Select * from “$My Table”’,ADOConn,2,3);
ADORst.Open('Select * from <company>$My Table',ADOConn,2,3);
Nothing works. The error I receive is: “Invalid Object Name”
Here is all the code:
ConnStr := ‘Provider=SQLOLEDB.1;Password=mypassword;User ID=sa;database=’+MYDATABASE+’;Data Source=’+MYDATASOURCE;
CREATE(ADOConn);
ADOConn.Open(ConnStr);
CREATE(ADORst);
ADORst.Open(‘Select * from $My Table’,ADOConn,2,3);
Both databases are running Navision 4.0 SP3.
Thanks!!