Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using the below code for opening a csv file but ending up with the error as "Could not find the installable ISAM".


VB
Conn1 = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D:\\Sample;""Extended Properties = ""text;HDR=Yes;FMT = Delimited(;)"";Persist Security Info = False"


Please suggest me a solution for this.
Posted
Updated 27-Aug-14 3:52am
v2
Comments
Richard MacCutchan 27-Aug-14 4:57am    
Have you installed the Jet library on your system?
dineskn 28-Aug-14 1:43am    
Yes its installed. I have the following dll files in my systeem folder
msjet40
msjetoledb40
msjint40
msjter40
msjtes40

I have run some tests and there is an error in your connection string. You have
VB
Conn1 = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D:\\Sample;""Extended Properties = ""text;HDR=Yes;FMT = Delimited(;)"";Persist Security Info = False"

But I used the following which works:
VB
Conn1 = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D:\\Sample;Extended Properties = ""text;HDR=Yes;FMT = Delimited(;);Persist Security Info = False""";

Note the positioning of the double quotes within the connection string; all the extended properties should be within the one set of quotes like:
VB
Extended Properties = "<all extended properties go here>" 
 
Share this answer
 
v2
Comments
dineskn 28-Aug-14 7:43am    
Thanks Richard. The code works fine now and no issues.
Richard MacCutchan 28-Aug-14 9:31am    
Happy to help.
Don't forget to mark this as Solution.
PhilLenoir 28-Aug-14 9:07am    
Well spotted that man!
There are three possible causes from my experience:

1) The installable ISAM (Indexed Sequential Access Method) driver is not installed. This is the most likely cause. ISAMs include text files and DBFs. The following link explains these in full and what support files you need. Typically I install these by updating my import/export option for Access in my Office installation:
http://support.microsoft.com/kb/209805[^]

2) The text driver is installed but not initialized, see:
http://office.microsoft.com/en-us/access-help/initializing-the-text-data-source-driver-HP001032166.aspx[^]

3) The error is lying! I can only recall seeing this on DBF files and older versions. A typical cause used to be a DBF with a long file name, although more recently the message for this is "Couldn't find file". If the above do not fix the problem, I'd attempt to load a file with a short name in a simple folder (e.g., "C:\test\test.csv"), but you're on your own if 1 or 2 didn't fix the problem!
 
Share this answer
 
Comments
dineskn 28-Aug-14 3:18am    
I checked the path for the below registry entries and seems to be provided correct.
Msexcl40.dll
Msexch40.dll
Msrd2x40.dll
Msrd3x40.dll
Msltus40.dll
Mspbde40.dll
Mstext40.dll
Msxbde40.dll

And also i found the mstext40.dll (text driver file) as well and it has been initialized. Yet i'm facing the same issue again.

Here is my code that i'm tried to run.


Dim Cn1 As ADODB.Connection
Dim rRs1, rRs2 As ADODB.Recordset
Dim sQuery_policy1, strFilename1 As String
Dim Conn1 As String
Dim Res As Variant
strFilename1 = "C:\Users\dineshkumarn\Documents"
On Error GoTo DBError:
Application.DisplayAlerts = False
Sheet2.Name = "Compared Result"

j = 1
l = 1
con = 2

Conn1 = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D:\\Sample;""Extended Properties = ""text;HDR=Yes;FMT = Delimited(;)"";Persist Security Info = False"
Set Cn1 = New ADODB.Connection
Set rRs1 = New ADODB.Recordset
Cn1.ConnectionString = Conn1
Cn1.CursorLocation = adUseClient
Cn1.Open (Conn1)
sQuery_policy1 = Sheet1.TextBox1.Value
Set rRs1 = Cn1.Execute(Trim(sQuery_policy1))


For i = 0 To rRs1.Fields.Count - 1
Sheet2.Cells(1, j).Value = rRs1.Fields(i).Name
j = j + 1
Next i

While Not rRs1.EOF
For k = 0 To rRs1.Fields.Count - 1
Sheet2.Cells(con, 1).Value = rRs1.Fields(k).Value
l = l + 1
Next k
con = con + 1
l = 1
Wend

rRs1.Close
Cn1.Close

DBError:
If Err.Number <> 0 Then
MsgBox Err.Number & " : " & Err.Description
End If

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900