PDA

View Full Version : ADO Connection



dhartford
08-17-2008, 09:32 PM
Help is needed. Thanks in advance.

I have the following code to transfer data from Access to Excel. I received error msg: "Data source name not found and no default driver specified". Data source name is correct with correct path:



Private Sub cmdSubmit_Click()
Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection

Dim strConn As String

strConn = "Microsoft.Jet.OLEDB.4.0" & _
"Data source = F:\View\Viewer_fname.xlsx;" & _
"Extended Properties=Excel 12.0 Xml;HDR=YES"

cnn.Open strConn

Debug.Print strConn
End Sub

Mavyak
08-18-2008, 09:02 AM
Duplicate post. Go here with all replies:

http://vbaexpress.com/forum/showthread.php?t=21597

Admin, please lock this thread.