Connection strings woes for .csv files

Connection strings woes for .csv files

Post by berneck » Fri, 28 Jan 2000 04:00:00



I'm having a problem getting a .csv connection string passed
to OLAP in an MDX statement. The immediate problem is
a syntax error in the expression:
   Driver=Microsoft Text Driver (*.csv, *.txt), ...

MDX croaks on the *.csv, but using " or ' or { gives
a different MDX error. If I define the driver using
ODBC /control panel services, it's OK, but I'd rather not
foist that setup requirement on clients. I prefer to generate
the entire string automatically. Does anybody have any ideas
on how to workaround this one? Or know if a fix exists?

Thanks.

--
Robert Bernecky                  Snake Island Research Inc.

+1 416 203 0854                   Toronto, Ontario M5J 2B9 Canada
http://www.snakeisland.com

 
 
 

Connection strings woes for .csv files

Post by carlm.. » Sat, 12 Feb 2000 04:00:00


There should be semi-colon after '*.csv' not a comma.



> I'm having a problem getting a .csv connection string passed
> to OLAP in an MDX statement. The immediate problem is
> a syntax error in the expression:
>    Driver=Microsoft Text Driver (*.csv, *.txt), ...

> MDX croaks on the *.csv, but using " or ' or { gives
> a different MDX error. If I define the driver using
> ODBC /control panel services, it's OK, but I'd rather not
> foist that setup requirement on clients. I prefer to generate
> the entire string automatically. Does anybody have any ideas
> on how to workaround this one? Or know if a fix exists?

> Thanks.

> --
> Robert Bernecky                  Snake Island Research Inc.

> +1 416 203 0854                   Toronto, Ontario M5J 2B9 Canada
> http://www.snakeisland.com

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. ADO Connection String in VC++ for .csv files

Hello everybody.
I have problem in opening the ado connection when working with text file
(.txt or .csv).
This problem occurs only in VC++, the connection works well in VB.
Here is the Connection string in VB:

strText = "F:\Amir\vbProjects\test\"
cn.Open "Driver={Microsoft Text Driver (*.txt;" _
          & " *.csv)};dbq=" & strText & "; Extensions=asc,csv,tab,txt;"
rs.Open TestString.Text, cn, adOpenStatic, adLockReadOnly

.. This works ok but when using this code in VC++:

#define MY_CONNECTION_STRING  L"Driver={Microsoft Text Driver (*txt;
*.csv)};DBQ=F:\\Amir\\vbProjects\\test\\; Extensions=asc,csv,tab,txt;"

    Conn->ConnectionString = MY_CONNECTION_STRING;
    Conn->Open( bstrEmpty, bstrEmpty, bstrEmpty, -1);

I get an error : '[Microsoft][ODBC Driver Manager] Data source name not
found and no default driver specified'
Can anyone help me with this one?

2. Execute Queries

3. Connection string woes

4. SC-ORACLE FINANCIALS

5. Error accessing CSV datasource with DSN-less connection string

6. Download VB 5.0

7. Exporting long strings to csv file

8. date/time format

9. Creating a DTS CSV File Source/Destination Connection

10. Connection to CSV data files

11. No idea how to get a connection with a a excel *.csv file

12. I want to store the Full DSN/Connection string in a config file BUT

13. how to upload data from Excel file (.csv file) into MSSQL table (ver 6.5)