Crystal Reports and CODBC 3.7: linking two tables
SG
Member Posts: 3
I'm using Crystal Reports XI with C/ODBC 32 bit driver in version 3.70.00.13164.
When I need data from just one table, everything is fine. When I e.g. try to use the Table Customer and Salesperson/Purchaser to show the name of the salesperson for every customer, I get an error.
I linked the tables by the Crystal Reports Database Expert with Customer.Salesperson Code left outer join on Salesperson/Purchaser.Code
The Error:
Failed to retrieve data from the database
Details: ADO Error Code: 0x80040e14
Source: Microsoft OLE DB Provider for ODBC Drivers
Description: [Microsoft Business Solutions ApS] [Microsoft Business Solutions -Navision ODBC Driver]Expected lexical element not found: <identifier>
SQL State: 37000
Native Error: 1015 [Database Vendor Code: 1015]
Just to test, I connected to the Database by MS Access through two linked tables (data still in the Navision DB). Then I used this two linked tables from Crystal Reports with the Access database the same way I tried it "direct" with the C/ODBC 32 bit driver. Everything worked fine :?:
Is the implementation of the C/ODBC driver poorly - or did I somthing wrong? Do I have to change some connection settings?
I also tried it with the MS Navision 4.0 ODBC, but it refused the connection to a 3.7 database
](*,) I'm out of ideas now. Can anyone help?
When I need data from just one table, everything is fine. When I e.g. try to use the Table Customer and Salesperson/Purchaser to show the name of the salesperson for every customer, I get an error.
I linked the tables by the Crystal Reports Database Expert with Customer.Salesperson Code left outer join on Salesperson/Purchaser.Code
The Error:
Failed to retrieve data from the database
Details: ADO Error Code: 0x80040e14
Source: Microsoft OLE DB Provider for ODBC Drivers
Description: [Microsoft Business Solutions ApS] [Microsoft Business Solutions -Navision ODBC Driver]Expected lexical element not found: <identifier>
SQL State: 37000
Native Error: 1015 [Database Vendor Code: 1015]
Just to test, I connected to the Database by MS Access through two linked tables (data still in the Navision DB). Then I used this two linked tables from Crystal Reports with the Access database the same way I tried it "direct" with the C/ODBC 32 bit driver. Everything worked fine :?:
Is the implementation of the C/ODBC driver poorly - or did I somthing wrong? Do I have to change some connection settings?
I also tried it with the MS Navision 4.0 ODBC, but it refused the connection to a 3.7 database
](*,) I'm out of ideas now. Can anyone help?
0
Comments
-
as far as i remember c\odbc does not support left outter joins. unless this has been fixed?
are you using SQL or Native Database0 -
I'm using the native database and tried the inner join as well. Same problem - only the description and the native error code are a little different:
Description: [Microsoft Business Solutions ApS] [Microsoft Business Solutions -Navision ODBC Driver]Unexpected extra token: INNER
Native Error: 1017 [Database Vendor Code: 1017]
Is there a list of the Native Error Codes for C/ODBC or native Navision DB?
When I change the data source of the same report to the Access DB with the tables linked to the Navision DB, everythin works.
It's also no problem if I use a Left (Outer) Join or a Inner Join Query direct in Access.
I agree that c/odbc doesn't support joins. The only answer, why I get results by MS Access you can see in the ODBC logs :evil: :
Direct with queries from Access:
INNER JOIN
LEFT OUTER JOIN
"SELECT "Code" ,"Salesperson/Purchaser"."Code" FROM "Salesperson/Purchaser" WHERE ("Code" = ?)\ 0"
"SELECT "Code","Name" FROM "Salesperson/Purchaser" WHERE "Code" = ? OR "Code" = ? OR "Code" = ? OR "Code" = ? OR "Code" = ? OR "Code" = ? OR "Code" = ? OR "Code" = ? OR "Code" = ? OR "Code" = ?\ 0"It looks like Access fetches the data of both tables and merges them internal. The log for the Crystal Reports queries over Access looks similar and do also works. The following lines are from the log when I tried to access the Navision DB direct from Crystal Reports without the Access Links:
INNER JOIN
LEFT OUTER JOIN
In the end I'm forced to go a long way round with MS Access if I use C/ODBC driver from Navision. I won't call this a "solution" [-(
Does anyone know a smart driver (or solution) that I can use instead of C/ODBC and MS Access? [-o<0 -
I use Crystal 9 so maybe it's different.
But here are my steps...
1) New Report
2)Select Blank Report
3) Select ODBC (RDO)
4) There I see My Source Data Name I Have Created "My Data"
5)Select My Tables I want to Use
6)Click on the link Tab -> then Clear Links (Cause their always wrong)
7)link two of the fields
click OK & it's ready to go.
I've never had a problem linking two related tables. I Have also never needed to change the link options. I leave it as default - no problems.
Once in a while it's good to check the database in case it's been updated
Database->Verify Database0 -
I had the same issue with CR XI and C/ODBC drivers with Navision 3.7
The drivers worked fine with MS Access 2003 so I ended up creating an Access database with linked tables to the Navision instance and then pointing Crystal reports at the MS Access database.. worked a treat.
totally nuts solution I know.. but I couldn't find any other way around it either.
hope that helps
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 329 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions