0
votes

I am trying top open an xlsx file using classic ASP and ADO

The connection string is below. But it produces an error. What am I doing wrong?

Driver=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Derek Cohen\Documents\!!websites\demographix\surveys\AKGW-YHSN\pu_VTGDVVJZ_56_4088906840162.xlsx;Extended Properties=Excel 12.0;HDR=Yes;IMEX=1;

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name too long 
1

1 Answers

0
votes

Microsoft.ACE.OLEDB.12.0 is a provider so your connection string isn't valid. Try the following:

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Provider = "Microsoft.ACE.OLEDB.12.0"
objConn.ConnectionString = "Data Source=C:\Users\Derek Cohen\Documents\!!websites\demographix\surveys\AKGW-YHSN\pu_VTGDVVJZ_56_4088906840162.xlsx;Extended Properties=""Excel 12.0;HDR=Yes;IMEX=1;"""
objConn.Open

A few connection string examples for the Excel 12