ODBC Connectivity error [ProviceX] [ODBC] Unexpected extra token. I am using VFP 9.0 connecting to a MAS90 database. The connection is made but when trying to define remote views (after selecting the table from the MAS90 table list) the above error occurs. Any ideas? Thanks in advance.
That message usually denotes that a character combination has been interpreted by the ODBC driver in an odd way and it gets translated into an extra byte value in a terminated string.
Unfortunately, I can't find any details in their documentation which seems to cover errors as a slight afterthought.
I checked a little further and see some odd date handling to MS SQL Server can generate that type of error message. I can assume that MS, the company with the ODBC standards, has that "Unexpected extra token" message as a catch-all message that only reports the symptom and is short on details much like many MS error messages seem to be.
In the ODBC setup, you may want to turn on ODBC Tracing to see if the subsequent log file contains any clues in whatever strings you are trying to send to MAS90.
I'm not sure about anyone else, but i have had nothing but trouble with the MAS90 ProvideX driver. I don't believe that it is fully ODBC compliant. the fact that there are no third party tools for it should be evidence enough. At least none that i have seen. They own all the extended solutions. what exactly are you trying to do anyway? Have you tried Access. It works fairly well for reading data.
The MAS90 providex driver is not fully ODBC compliant.
A unexpected extra token is usaully because of a syntax error. There is special conventions when the pvx driver uses that aren't normal. I use vb and vbscript to read MAS90 tables (note: the providex driver is ready only).
Anyway I don't know that much about VPF but here is a VB code using sql queriy that will show you how funcky it is just to do a inner join.
Private Sub Form_Load() Dim myconnection Dim myRecordset Dim sql Dim str Dim objFS Dim objFile Dim strcon strcon = "DSN=SOTAMAS90;UID=youruserid|yourcompany;PWD=yourpwrd" Set myconnection = CreateObject("ADODB.Connection") Set myRecordset = CreateObject("ADODB.Recordset") myconnection.Open strcon
sql = "SELECT AR_InvoiceHistoryHeader.SalesOrderNo as a ,AR_InvoiceHistoryHeader.InvoiceDate as b, " & _ "AR_InvoiceHistoryTracking.StarshipShipVia as c,AR_InvoiceHistoryTracking.Weight as d,AR_InvoiceHistoryTracking.TrackingID as e " & _ "FROM " & _ "{IJ AR_InvoiceHistoryTracking INNER JOIN AR_InvoiceHistoryHeader ON " & _ "AR_InvoiceHistoryTracking.InvoiceNo = AR_InvoiceHistoryHeader.InvoiceNo} " & _ "WHERE " & _ "AR_InvoiceHistoryHeader.SalesOrderNo LIKE " & Chr(39) & "W%" & Chr(39) & "AND " & _ "AR_InvoiceHistoryHeader.InvoiceDate > ({ fn CURDATE()}-4)"
myRecordset.Open sql, myconnection Set objFS = CreateObject("Scripting.FileSystemObject") Set objFile = objFS.CreateTextFile("C:\TESTFILE.TXT", True, False) Do While Not myRecordset.EOF objFile.WriteLine myRecordset("a") & "," & _ myRecordset("b") & "," & _ myRecordset("c") & "," & _ myRecordset("d") & "," & _ myRecordset("e")
myRecordset.MoveNext Loop objFile.Close myconnection.Close Set objFile = Nothing Set ogJFS = Nothing Set myRecordset = Nothing Set myconnection = Nothing Unload Form1
This code is a part of a tracking export program that I run scheduled daily to put tracking numbers from our web orders back onto our website. It basically queries MAS90 for the tracking info ....within 4 days to compensate for weekends. and puts that In a text file. I have a DTS package that executes through enteprise manager(sql) and picks up this text file and goes through some proccesses to update our web orders table.