MS Access queries don't work with parameters using NODBC
Faberman
Member Posts: 24
Hi,
We have recently upgraded to Navision v4.0 SP3 and historically I have constructed MS Access dBs which link to Navision tables as ODBC sources so that I can query them.
The queries are usually simple SELECT statements in which parameters are passed to the query using a form.
Now I am trying to do the same with NODBC and I find that I can only use dates as parameters while Strings and Integers cause the dreaded "ODBC - call failed" message to appear.
For example :
SELECT Sales_Invoice_Header.No_, Sales_Invoice_Header.Sell_to_Customer_No_, Sales_Invoice_Header.Bill_to_Name, Sales_Invoice_Header.Invoice_Value, Sales_Invoice_Header.Posting_Tax_Point_Date
FROM Sales_Invoice_Header
WHERE (((Sales_Invoice_Header.Sell_to_Customer_No_)="5273") AND ((Sales_Invoice_Header.Posting_Tax_Point_Date) Between [forms]![x]![x] And [forms]![x]![y]));
If I run this as is, it works fine.
(with dates as 01/01/07 format)
If I change the "5273" to, say, [forms]![form1]![accno] the ODBC call fails.
I t makes no difference whether a String is passed or an Integer, the query fails.
I have found the same problem using MS Access 2000 and 2007, and I have tried it on several machines, which leads me to believe that it is an NODBC driver issue.
The driver options are configured thus :
Identifiers : a-z,A-Z,0-9;_
Language : Auto (Windows Language) i.e. United Kingdom
Option Field Type : Text
Commit Cache : Yep
DBMS Cache (KB) : 8000
Read Only : Yep
I'm pointing to a server, TCP net type, username & password is in, also the company name etc. etc.
Nothing appears to be any different from before when I used the C/ODBC driver.
Can anyone help???????
](*,)
Can anyone explain what has changed or what needs to be changed to get this working again?
We have recently upgraded to Navision v4.0 SP3 and historically I have constructed MS Access dBs which link to Navision tables as ODBC sources so that I can query them.
The queries are usually simple SELECT statements in which parameters are passed to the query using a form.
Now I am trying to do the same with NODBC and I find that I can only use dates as parameters while Strings and Integers cause the dreaded "ODBC - call failed" message to appear.
For example :
SELECT Sales_Invoice_Header.No_, Sales_Invoice_Header.Sell_to_Customer_No_, Sales_Invoice_Header.Bill_to_Name, Sales_Invoice_Header.Invoice_Value, Sales_Invoice_Header.Posting_Tax_Point_Date
FROM Sales_Invoice_Header
WHERE (((Sales_Invoice_Header.Sell_to_Customer_No_)="5273") AND ((Sales_Invoice_Header.Posting_Tax_Point_Date) Between [forms]![x]![x] And [forms]![x]![y]));
If I run this as is, it works fine.
(with dates as 01/01/07 format)
If I change the "5273" to, say, [forms]![form1]![accno] the ODBC call fails.
I t makes no difference whether a String is passed or an Integer, the query fails.
I have found the same problem using MS Access 2000 and 2007, and I have tried it on several machines, which leads me to believe that it is an NODBC driver issue.
The driver options are configured thus :
Identifiers : a-z,A-Z,0-9;_
Language : Auto (Windows Language) i.e. United Kingdom
Option Field Type : Text
Commit Cache : Yep
DBMS Cache (KB) : 8000
Read Only : Yep
I'm pointing to a server, TCP net type, username & password is in, also the company name etc. etc.
Nothing appears to be any different from before when I used the C/ODBC driver.
Can anyone help???????
](*,)
Can anyone explain what has changed or what needs to be changed to get this working again?
0
Categories
- All Categories
- 75 General
- 75 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions