Dave,
the problem appears to be in the data connection wizard. Even though the
ODBC DSN is being selected, when it creates the odc connect file it is
putting OLEDB into the file. Here's an example of the failing xml
<html xmlns
="urn:schemas-microsoft-com
ffice
ffice"
xmlns="
http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/x-ms-odc; charset=utf-8">
<meta name=ProgId content=ODC.Table>
<meta name=SourceType content=OLEDB>
<meta name=Catalog content="C:\TEMP">
<meta name=Table content=odbctest.txt>
<title>test.odbctest.txt</title>
<xml id=docprops><o
ocumentProperties
xmlns
="urn:schemas-microsoft-com
ffice
ffice"
xmlns="
http://www.w3.org/TR/REC-html40">
<o
escription>test connect to odbc source</o
escription>
<o:Name>test.odbctest.txt</o:Name>
</o
ocumentProperties>
</xml><xml id=msodc><odc:OfficeDataConnection
xmlns
dc="urn:schemas-microsoft-com
ffice
dc"
xmlns="
http://www.w3.org/TR/REC-html40">
<odc:Connection odc:Type="OLEDB">
<odc:ConnectionString>Provider=MSDASQL.1;Persist Security
Info=True;Extended
Properties="DSN=odbctest;DefaultDir=C:\TEMP;DriverId=27;FIL=text;MaxBufferSize=2048;PageTimeout=5;";Initial
Catalog=C:\TEMP</odc:ConnectionString>
<odc:CommandType>Table</odc:CommandType>
<odc:CommandText>`C:\TEMP`\`odbctest.txt`</odc:CommandText>
</odc:Connection>
<odc:Connection odc:Type="ODBC">
<odc:ConnectionString>DSN=odbctest;DefaultDir=C:\TEMP;DriverId=27;FIL=text;MaxBufferSize=2048;PageTimeout=5;</odc:ConnectionString>
<odc:CommandText>SELECT * FROM `C:\TEMP`\`odbctest.txt`</odc:CommandText>
</odc:Connection>
</odc:OfficeDataConnection>
</xml>
when I change the OLEDB references to ODBC the import works correctly. Here
are the corrections
<html xmlns
="urn:schemas-microsoft-com
ffice
ffice"
xmlns="
http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/x-ms-odc; charset=utf-8">
<meta name=ProgId content=ODC.Table>
<meta name=SourceType content=ODBC>
<meta name=Catalog content="C:\TEMP">
<meta name=Table content=odbctest.txt>
<title>test.odbctest.txt</title>
<xml id=docprops><o
ocumentProperties
xmlns
="urn:schemas-microsoft-com
ffice
ffice"
xmlns="
http://www.w3.org/TR/REC-html40">
<o
escription>test connect to odbc source</o
escription>
<o:Name>test.odbctest.txt</o:Name>
</o
ocumentProperties>
</xml><xml id=msodc><odc:OfficeDataConnection
xmlns
dc="urn:schemas-microsoft-com
ffice
dc"
xmlns="
http://www.w3.org/TR/REC-html40">
<odc:Connection odc:Type="ODBC">
<odc:ConnectionString>Provider=MSDASQL.1;Persist Security
Info=True;Extended
Properties="DSN=odbctest;DefaultDir=C:\TEMP;DriverId=27;FIL=text;MaxBufferSize=2048;PageTimeout=5;";Initial
Catalog=C:\TEMP</odc:ConnectionString>
<odc:CommandType>Table</odc:CommandType>
<odc:CommandText>`C:\TEMP`\`odbctest.txt`</odc:CommandText>
</odc:Connection>
<odc:Connection odc:Type="ODBC">
<odc:ConnectionString>DSN=odbctest;DefaultDir=C:\TEMP;DriverId=27;FIL=text;MaxBufferSize=2048;PageTimeout=5;</odc:ConnectionString>
<odc:CommandText>SELECT * FROM `C:\TEMP`\`odbctest.txt`</odc:CommandText>
</odc:Connection>
</odc:OfficeDataConnection>
</xml>
Al
Dave xxiii said:
I have now tried the microsoft odbc text driver, which shows a similar
symptom. I'm pretty sure at this point that its a problem in either visio,
or
the ole db provider for odbc.
details:
c:\odbctest.txt:
id,name
1,"wendy"
2,"tom"
3,"fred"
User Data Sources:
text test Microsoft Text Driver (*.txt; *.csv):
Data Source Name: text test
Directory: C:\
Other options left at defaults.
In Visio 2007:
NEW select detailed network diagram
Data->link data to shapes
select Other OLEDB or ODBC data source
click next
select ODBC DSN
click next
select text test
click next
select odbctest.txt
click next
click finish (let it save connection with default generated name,
odbctest.txt.odc)
this is now selected in what connection do you want to use dialog, click
next
Visio generates:
Microsoft Office Visio cannot connect to this data source.
click More Info
Error 80040e14: [Microsoft][ODBC Text Driver] Syntax error in FROM clause.
I turned on ODBC global tracing before doing this and the relevent lines
from the log read thusly:
WCHAR * 0x049B3920 [ 36] "SELECT * FROM
`C:\``\``odbctest.txt`"
SDWORD 36
DIAG [37000] [Microsoft][ODBC Text Driver] Syntax error in FROM clause.
(-3506)
Note that it individually quoted the \ character, similar to when it
individually quotes the . character between the schema name and the table
name in my earlier example.
This now shows the problem with two totally separate odbc drivers, in the
second case one provided by microsoft.
Question: do they monitor these groups, or is there anywhere better to
report these sorts of things without using up a support incident?